Remove User In role

Jun 7, 2013 at 2:40 PM
Hello,

In my program, I have an admin section. Only users with the role "admin" can access.

They can to add or remove a user to a role.
The system of delegation is not adapted.

I have this code to start :
 string cs = FCT_CHAINECONNEXION();

            
            IAzManStorage storage = new SqlAzManStorage(cs);

            IAzManItem item = storage["RCMAzman"][FCT_NAME_APPLICATION()][role];
Best Regard

Dewey
Coordinator
Jun 7, 2013 at 2:42 PM
Ok ... but which is the question ?
Jun 7, 2013 at 3:21 PM
I try this :
IAzManItem u1 = storage["RCMAzman"][FCT_NOM_APPLICATION()].GetItem("Tristan DUPOND");

item.RemoveMember(u1);
But I have an error in the first line.

u1 must be of the type : IAzManItem !!
Coordinator
Jun 7, 2013 at 3:35 PM
Hi Dewey,
You must use the item.Delete() method ... to delete from Database
RemoveMember removes the member just from memory only (collections pattern).

Regards,
Andrea.
Jun 7, 2013 at 6:01 PM
Edited Jun 7, 2013 at 7:52 PM
Thanx you

but I want to remove the member (Tristan DUPOND) of a role ([FCT_NOM_APPLICATION() --> return "monrole").

What is the function to do this?

item.Delete delete my role no ?
Coordinator
Jun 9, 2013 at 10:03 AM
Ok, now I have understood.

Could you please send me the exported xml of the entire NetSqlAzMan application ?

Regards,
Andrea.
Jun 10, 2013 at 9:09 AM
Edited Jun 10, 2013 at 12:13 PM
I found my solution in your "Source Code" :

NetSqlAzManRoleProvider.cs --> RemoveUsersFromRoles

Perfect

Thank you very much !

Best regard,
Dewey
Coordinator
Jun 11, 2013 at 7:12 AM
:-)

Great.