Who's this admin guy anyway?

Last post 04-21-2006, 2:41 PM by jdmaynard. 2 replies.
Sort Posts: Previous Next
  •  04-20-2006, 12:53 PM 18382

    Who's this admin guy anyway?

    Sorry, this will seem like a gormless question, but...
     
    It's not clear to me how CE decides whether a user is an administrator. In particular how do we convince it that a logged in user should get access to admin settings or just default settings?
     
    DOug
  •  04-20-2006, 2:01 PM 18384 in reply to 18382

    Re: Who's this admin guy anyway?

    DOug,
     
    You need to implement your own methods based on your project to detect the current user security role:
     

       string userrole= GetSecurityRoleFromYourAPP();
       switch(userrole)
       {
        case "Administrators":
         Editor1.SecurityPolicyFile  = "Admin.config";
         SetUploadsFolder("~/Uploads/");
         break;
        case "Members":
         Editor1.SecurityPolicyFile  = "default.config";
         SetUploadsFolder("~/Uploads/Member/");
         break;
        case "Guest":
         Editor1.SecurityPolicyFile  = "Guest.config";
         SetUploadsFolder("~/Uploads/Guest/");
         break;
      //  case "Banned":
      //   Editor1.ReadOnly = true;
      //   break;

         case "John":
         Editor1.SecurityPolicyFile  = "Admin.config";
         SetUploadsFolder("~/Uploads/Users/John/");
         break;
        case "Mary":
         Editor1.SecurityPolicyFile  = "default.config";
         SetUploadsFolder("~/Uploads/Users/Mary/");
         break;
        case "Tim":
         Editor1.SecurityPolicyFile  = "default.config";
         SetUploadsFolder("~/Uploads/Users/Tim/");
         break;
       }
     
    Keep me posted
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  04-21-2006, 2:41 PM 18423 in reply to 18384

    Re: Who's this admin guy anyway?

    Thanks, great answer.
     
    So, in my case, where there's only going to be one kind of user - administrator - can I just poke this into the <CE:Editor ... > tag something like:
     
    <CE:Editor id="ceContent" AutoConfigure="Full"  SecurityPolicyFile  = "Admin.config" UploadsFolder="~/Uploads/" ... etc.  />
     
    <thinks>
    In fact, the uploads folder is already in the Admin.config file so I won't need that ... things just get better and better.
    </thinks>
     
    Thanks again
     
    DOug
View as RSS news feed in XML