Kurser och utbildning av IT-proffs och systemutvecklare

i Sök

Cornerstones utvecklarblogg

Alla Taggar

All Tags » Permission Manager   (RSS)
Sorry, but there are no more tags available to filter with.

  • Permission Manager for .Net 2.0

    Because the Workspace for the Permission Manager will soon be shutdown; I have added the package to my blog.

     

    Here is a short introduction to the Permission Manager for the readers who haven’t heard of it before.

     

    With the Permission Manager you can set any kind of permission on any kind of object for both users and roles (It will use the Roles feature of ASP.Net). The Permission Manager is also provider based. The following is and example of how you can check if a user has a specific global permission (Don’t need to set permission only to object, it can also be used to specify global permissions):

     

    if (PermissionManager.HasUserPermission("John Doe", "Read"))

        Response.Write("User has permission to read..");

     

    The following is an example where we check if a user has the right to read “MyNews” that belongs to the object category “News”:

     

    if (PermissionManager.HasUserPermission("John Doe","News","MyNews","Read"))

       Response.Write("User has permission to read the news MyNews..");

     

    The follwing code will set permission on an object and also check if a role has “read” permission:

     

    News news = new News();

    news.ID = 10;

     

    PermissionManager.SetPermissionForRole("Everyone", news, "Write");

     

     

     

     

    if (PermissionManager.HasRolePermission("Everyone", news, "Write"))

       Response.Write("Everyone has the permission to modify the news");

     

    This is only some basic thing you can do with the permission manager, you can a lot more. The following links will provide you with more information:

     

    Permission Manager for .Net 2.0

     

    You can download the Permission Manager here.



    Computers Blogs - Blog Top Sites
    Bloggtoppen.se

Den här bloggen

Syndication