Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/09/10 19:45:54 (14 years ago)
Author:
fruehrli
Message:

added comment for roleprovider (#1046)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs

    r4024 r4026  
    1212
    1313
    14 
     14    /// <summary>
     15    /// adds each user in "usernames" to each role in "rolenames",
     16    /// if both user and role exists
     17    /// </summary>
     18    /// <param name="[]usernames"></param>
     19    /// <param name="[]roleNames"></param>
     20    /// <returns></returns>
    1521    public override void AddUsersToRoles(string[] usernames, string[] roleNames) {
    1622      if (usernames != null && roleNames != null) {
     
    3036      }
    3137    }
    32 
     38   
     39    /// <summary>
     40    /// gets or sets application name (implicit parameter application name)
     41    /// </summary>
     42    /// <param [name="value"]></param>
     43    /// <returns></returns>
    3344    public override string ApplicationName {
    3445      get {
     
    4051    }
    4152
     53    /// <summary>
     54    /// Creates a new role with permission "false"
     55    /// (Calls virtual method "CreateRole")
     56    /// </summary>
     57    /// <param name="roleName"></param>
     58    /// <returns></returns>
    4259    public override void CreateRole(string roleName) {
    4360      CreateRole(roleName, false);
     
    4562    }
    4663
     64    /// <summary>
     65    /// Creates and inserts a new role if param "roleName" != null
     66    /// </summary>
     67    /// <param name="roleName"></param>
     68    /// <param name="isPermission"></param>
     69    /// <returns></returns>
    4770    public virtual void CreateRole(String roleName, bool isPermission) {
    4871      if (roleName != null) {
     
    5780    }
    5881
    59     //
    60     // RoleProvider.DeleteRole
    61     //
     82    /// <summary>
     83    /// Deletes role from system and returns true if role has been deleted or false if not
     84    /// </summary>
     85    /// <param name="roleName"></param>
     86    /// <param name="throwOnPopulatedRole"></param>
     87    /// <returns>true or false</returns>
    6288    public override bool DeleteRole(string roleName, bool throwOnPopulatedRole) {
    6389      String[] roleArray = new String[1];
     
    83109      return true;
    84110    }
    85 
     111   
     112    /// <summary>
     113    /// Returns string array with username if string "usernameToMatch" is find in "roleName",
     114    /// or an empty array if not
     115    /// </summary>
     116    /// <param name="roleName"></param>
     117    /// <param name="usernameToMatch"></param>
     118    /// <returns>string-array with username</returns>
    86119    public override string[] FindUsersInRole(string roleName, string usernameToMatch) {
    87120      List<string> returnValue = new List<string>();
     
    100133      return returnValue.ToArray();
    101134    }
    102 
     135   
     136    /// <summary>
     137    /// returns a string-array containing all HeuristicLabRole-rolenames
     138    /// </summary>
     139    /// <param></param>
     140    /// <returns>string-array containing role names</returns>
    103141    public override string[] GetAllRoles() {
    104142      List<string> roleList = new List<string>();
     
    113151      return roleList.ToArray();
    114152    }
    115 
     153   
     154    /// <summary>
     155    /// returns a string-array containing the rolenames of all roles associated to user "username"
     156    /// returns an empty array if user "username" does not exist or no roles are associated to the user
     157    /// </summary>
     158    /// <param name="username"></param>
     159    /// <returns>string-array containing rolenames</returns>
    116160    public override string[] GetRolesForUser(string username) {
    117161      List<string> roleList = new List<string>();
     
    142186   
    143187    }
    144 
     188   
     189    /// <summary>
     190    /// returns a string-array containing the usernames associated to the role "roleName"
     191    /// returns an empty array if "roleName" does not exist or no users are associated to the role
     192    /// </summary>
     193    /// <param name="roleName"></param>
     194    /// <returns>string-array containing usernames</returns>
    145195    public override string[] GetUsersInRole(string roleName) {
    146196      List<string> userList = new List<string>();
     
    157207      return userList.ToArray();
    158208    }
    159 
     209   
     210    /// <summary>
     211    /// returns true if both user "username" and role "roleName" exists and user is associated to role
     212    /// </summary>
     213    /// <param name="userame"></param>
     214    /// <param name="roleName"></param>
     215    /// <returns>true or false</returns>
    160216    public override bool IsUserInRole(string username, string roleName) {
    161217      bool returnValue = false;
     
    174230          }
    175231        }
    176 
    177 
    178 
    179232      }
    180233      context.Dispose();
    181234      return returnValue;
    182235    }
     236   
     237   
     238   
    183239    protected bool ResolveChildRoles(List<HeuristicLabRole> roles, string roleName)
    184240    {
     
    195251      return returnValue;
    196252    }
     253   
     254    /// <summary>
     255    /// Removes for each user in "usernames" each role in "roleNames" if both user and role exists in db
     256    /// and the role is associated to the user
     257    /// </summary>
     258    /// <param name="[]usernames"></param>
     259    /// <param name="[]roleNames"></param>
     260    /// <returns></returns>   
    197261    public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames) {
    198262
     
    214278    }
    215279
     280   
     281    /// <summary>
     282    /// Returns true if role "roleName" exists or false if not
     283    /// </summary>
     284    /// <param name="roleName"></param>
     285    /// <returns>true or false</returns>
    216286    public override bool RoleExists(string roleName) {
    217287
Note: See TracChangeset for help on using the changeset viewer.