Search code examples
c#c1-cms

Accessing user via C#


I am working on a custom handler hooked into composite c1 start up cycle. The C# code is working fine but I need to access the user info who is the approver for the current page.

I tried to use IUser interface but how can I get approver permission user for the current page.

Thanks in advance.


Solution

  • Not sure if you are asking how to get whom approved a page or to get the current user permissions for a given page. C1 does not keep track on whom approved a page. To get this feature you need to look into the versioning package. Getting the current user permissions for a given page can be done very easy!

    If you are running the latest 3.2 RC you can use the following code to get permissions for the current user and a given page:

    IPage currentPage; /* Initialize with the current page */ 
    var permissions = 
       PermissionsFacade.GetPermissionsForCurrentUser(currentPage.GetDataEntityToken());