From 17d01657a76259b270529f6cc7da12c57a06a653 Mon Sep 17 00:00:00 2001 From: Matteo Tomasini Date: Mon, 6 Jun 2011 15:24:25 +0200 Subject: [PATCH] Fixed permission check for Meta-Files editing. --- AssemblyVersion.cs | 4 ++-- WebApplication/Admin.master.cs | 13 ++++++++++++- WebApplication/AdminContent.aspx.cs | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index 4961b70..727ac68 100644 --- a/AssemblyVersion.cs +++ b/AssemblyVersion.cs @@ -16,5 +16,5 @@ using System.Reflection; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.4.572")] -[assembly: AssemblyFileVersion("3.0.4.572")] \ No newline at end of file +[assembly: AssemblyVersion("3.0.4.573")] +[assembly: AssemblyFileVersion("3.0.4.573")] \ No newline at end of file diff --git a/WebApplication/Admin.master.cs b/WebApplication/Admin.master.cs index 90b81b9..7e76043 100644 --- a/WebApplication/Admin.master.cs +++ b/WebApplication/Admin.master.cs @@ -94,7 +94,7 @@ namespace ScrewTurn.Wiki { lnkSelectConfig.Visible = CanManageConfiguration(currentUser, currentGroups); // Content (can manage config) - lnkSelectContent.Visible = CanManageConfiguration(currentUser, currentGroups); + lnkSelectContent.Visible = CanManageMetaFiles(currentUser, currentGroups); // Groups (can manage groups) lnkSelectGroups.Visible = CanManageGroups(currentUser, currentGroups); @@ -135,6 +135,17 @@ namespace ScrewTurn.Wiki { return canManageConfiguration; } + /// + /// Determines whether a user can manage the Meta-Files (Content). + /// + /// The username. + /// The groups. + /// true if the user can manage the Meta-Files (Content), false otherwise. + public static bool CanManageMetaFiles(string username, string[] groups) { + bool canManageMetaFiles = AuthChecker.CheckActionForGlobals(Actions.ForGlobals.ManageMetaFiles, username, groups); + return canManageMetaFiles; + } + /// /// Determines whether a user can manage categories in at least one namespace. /// diff --git a/WebApplication/AdminContent.aspx.cs b/WebApplication/AdminContent.aspx.cs index 1c0c309..5b779df 100644 --- a/WebApplication/AdminContent.aspx.cs +++ b/WebApplication/AdminContent.aspx.cs @@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki { protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); - if(!AdminMaster.CanManageConfiguration(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) UrlTools.Redirect("AccessDenied.aspx"); + if(!AdminMaster.CanManageMetaFiles(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) UrlTools.Redirect("AccessDenied.aspx"); if(!Page.IsPostBack) { // Load namespaces