CanManageNamespaces() public static method

Determines whether a user can manage namespaces.
public static CanManageNamespaces ( string username, string groups ) : bool
username string The username.
groups string The groups.
return bool
コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AdminMaster.RedirectToLoginIfNeeded();

            if (!AdminMaster.CanManageNamespaces(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames(DetectWiki())))
            {
                UrlTools.Redirect("AccessDenied.aspx");
            }

            if (!Page.IsPostBack)
            {
                rptNamespaces.DataBind();
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AdminMaster.RedirectToLoginIfNeeded();

            if (!AdminMaster.CanManageNamespaces(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames()))
            {
                UrlTools.Redirect("AccessDenied.aspx");
            }

            if (!Page.IsPostBack)
            {
                rptNamespaces.DataBind();

                // Populate themes
                string[] themes = Tools.AvailableThemes;
                foreach (string theme in themes)
                {
                    lstTheme.Items.Add(new ListItem(theme, theme));
                }
            }
        }