- Timestamp:
- 07/09/10 19:45:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs
r4024 r4026 12 12 13 13 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> 15 21 public override void AddUsersToRoles(string[] usernames, string[] roleNames) { 16 22 if (usernames != null && roleNames != null) { … … 30 36 } 31 37 } 32 38 39 /// <summary> 40 /// gets or sets application name (implicit parameter application name) 41 /// </summary> 42 /// <param [name="value"]></param> 43 /// <returns></returns> 33 44 public override string ApplicationName { 34 45 get { … … 40 51 } 41 52 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> 42 59 public override void CreateRole(string roleName) { 43 60 CreateRole(roleName, false); … … 45 62 } 46 63 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> 47 70 public virtual void CreateRole(String roleName, bool isPermission) { 48 71 if (roleName != null) { … … 57 80 } 58 81 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> 62 88 public override bool DeleteRole(string roleName, bool throwOnPopulatedRole) { 63 89 String[] roleArray = new String[1]; … … 83 109 return true; 84 110 } 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> 86 119 public override string[] FindUsersInRole(string roleName, string usernameToMatch) { 87 120 List<string> returnValue = new List<string>(); … … 100 133 return returnValue.ToArray(); 101 134 } 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> 103 141 public override string[] GetAllRoles() { 104 142 List<string> roleList = new List<string>(); … … 113 151 return roleList.ToArray(); 114 152 } 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> 116 160 public override string[] GetRolesForUser(string username) { 117 161 List<string> roleList = new List<string>(); … … 142 186 143 187 } 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> 145 195 public override string[] GetUsersInRole(string roleName) { 146 196 List<string> userList = new List<string>(); … … 157 207 return userList.ToArray(); 158 208 } 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> 160 216 public override bool IsUserInRole(string username, string roleName) { 161 217 bool returnValue = false; … … 174 230 } 175 231 } 176 177 178 179 232 } 180 233 context.Dispose(); 181 234 return returnValue; 182 235 } 236 237 238 183 239 protected bool ResolveChildRoles(List<HeuristicLabRole> roles, string roleName) 184 240 { … … 195 251 return returnValue; 196 252 } 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> 197 261 public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames) { 198 262 … … 214 278 } 215 279 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> 216 286 public override bool RoleExists(string roleName) { 217 287
Note: See TracChangeset
for help on using the changeset viewer.