Commits

Matteo Tomasini committed 206f524

Fixed permission check for Meta-Files editing.

Comments (0)

Files changed (3)

AssemblyVersion.cs

 //
 // 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")]
+[assembly: AssemblyVersion("3.0.4.573")]
+[assembly: AssemblyFileVersion("3.0.4.573")]

WebApplication/Admin.master.cs

 			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);
 		}
 
 		/// <summary>
+		/// Determines whether a user can manage the Meta-Files (Content).
+		/// </summary>
+		/// <param name="username">The username.</param>
+		/// <param name="groups">The groups.</param>
+		/// <returns><c>true</c> if the user can manage the Meta-Files (Content), <c>false</c> otherwise.</returns>
+		public static bool CanManageMetaFiles(string username, string[] groups) {
+			bool canManageMetaFiles = AuthChecker.CheckActionForGlobals(Actions.ForGlobals.ManageMetaFiles, username, groups);
+			return canManageMetaFiles;
+		}
+
+		/// <summary>
 		/// Determines whether a user can manage categories in at least one namespace.
 		/// </summary>
 		/// <param name="username">The username.</param>

WebApplication/AdminContent.aspx.cs

 		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