本文整理汇总了C#中Person.GetAuthority方法的典型用法代码示例。如果您正苦于以下问题:C# Person.GetAuthority方法的具体用法?C# Person.GetAuthority怎么用?C# Person.GetAuthority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person.GetAuthority方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load (object sender, EventArgs e)
{
state = ("" + Request["state"]).Trim().ToLower();
account = ("" + Request["account"]).Trim().ToLower();
currentUserId = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
_currentUser = Person.FromIdentity(currentUserId);
_authority = _currentUser.GetAuthority();
if (!_authority.HasPermission(Permission.CanEditMailDB, Organization.PPSEid, -1, Authorization.Flag.AnyGeographyExactOrganization))
{
Response.Write("You do not have authority to use this.");
Response.End();
}
if (!IsPostBack)
{
if (state == "edit")
{
LabelAccount.Text = account;
LabelAccount.Font.Bold = true;
addSpan.Visible = false;
pwTR.Visible = true;
ButtonDelete.Visible = true;
List<MailServerDatabase.MailAccount> objAccList = MailServerDatabase.SearchAccount(account);
TextBoxForward.Text = objAccList.Count > 0 ? "" + (objAccList[0].forwardedTo.Count > 0 ? objAccList[0].forwardedTo[0] : "") : "";
}
else if (state == "add")
{
LabelAccount.Text = "";
TextBoxAccount.Text = account;
addSpan.Visible = true;
pwTR.Visible = true;
ButtonDelete.Visible = false;
}
}
}
示例2: OnInitComplete
/// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
protected override void OnInitComplete (System.EventArgs e)
{
base.OnInitComplete(e);
int currentUserId = 0;
currentUserId = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
_currentUser = Person.FromIdentity(currentUserId);
_authority = _currentUser.GetAuthority();
}
示例3: Page_Load
protected void Page_Load (object sender, EventArgs e)
{
this.LanguageSelector1.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged);
viewingPerson = Person.FromIdentity(Int32.Parse(HttpContext.Current.User.Identity.Name));
Authority authority = viewingPerson.GetAuthority();
RadMenu MainMenu = FindControl("MainMenu") as RadMenu;
Dictionary<string, bool> enableCache = new Dictionary<string, bool>();
if (Session["MainMenu-v4_Enabling"] != null
&& PermissionCacheTimestamp.AddSeconds(10) > DateTime.Now
&& Authorization.lastReload < PermissionCacheTimestamp)
{
enableCache = Session["MainMenu-v4_Enabling"] as Dictionary<string, bool>;
}
else
PermissionCacheTimestamp = DateTime.Now;
Authorization.flagReload = false;
RadMenuItemCollection menuItems = MainMenu.Items;
SetupMenuItemsEnabling(authority, enableCache, menuItems);
Session["MainMenu-v4_Enabling"] = enableCache;
if (this.Page is PageV4Base)
{
bool CurrentPageAccess = false;
if (((PageV4Base)this.Page).pagePermissionDefault != null)
CurrentPageAccess = Authorization.CheckAuthorization(((PageV4Base)this.Page).pagePermissionDefault, -1, -1, authority, Authorization.Flag.AnyGeographyAnyOrganization);
if ((CurrentPageAccess == false && CurrentPageAllowed == false) || CurrentPageProhibited)
{
this.AccessDeniedPanel.Visible = true;
if (CurrentPageAccess == false)
{
this.LabelFailedPermission.Text = (((PageV4Base)this.Page).pagePermissionDefault).ToString();
}
else if (CurrentPageProhibited)
{
this.LabelFailedPermission.Text = "CurrentPageProhibited";
}
this.BodyContent.Visible = false;
}
else
{
this.AccessDeniedPanel.Visible = false;
this.BodyContent.Visible = true;
}
}
}
示例4: Page_Load
protected void Page_Load (object sender, EventArgs e)
{
_currentUser = Person.FromIdentity(CurrentUserId);
_authority = _currentUser.GetAuthority();
if (!Page.IsPostBack)
{
List<int> organizationIds = new List<int>();
foreach (Membership membership in DisplayedPerson.GetMemberships())
{
foreach (Organization org in membership.Organization.GetLine())
{
if (!organizationIds.Contains(org.Identity))
{
organizationIds.Add(org.Identity);
}
}
}
this.ViewState["Organizations"] = organizationIds.ToArray();
}
}
示例5: Page_Load
protected void Page_Load (object sender, EventArgs e)
{
int currentUserId = 0;
currentUserId = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
_currentUser = Person.FromIdentity(currentUserId);
_authority = _currentUser.GetAuthority();
_listedOrganisation = null;
if (ListedOrg != 0)
_listedOrganisation = Organization.FromIdentity(ListedOrg); ;
}