Delete An Authorization

Topics: NetSqlAzMan Core
Feb 23, 2011 at 8:49 AM


How Can I Delete An Authorization From a User?

i am using this code to create an authorization for a user .

Public Overloads Function AddUsersToRoles(ByVal Users As List(Of String), ByVal Roles As List(Of String)) As Boolean
            Dim FromDate As Date = Nothing
            Dim ToDate As Date = Nothing
            For Each user In Users
                For Each Role In Roles
                    Dim SelectedRole As IAzManItem = Storage(StoreName).Applications(ApplicationName
                    Dim SelectedUser As NetSqlAzMan.Interfaces.IAzManDBUser = Storage.GetDBUser(user)
                    Dim auth As IAzManAuthorization = SelectedRole.CreateAuthorization(SqlAzManSID.NewSqlAzManSid(), _
                                                                   WhereDefined.Database, SelectedUser.CustomSid, _
                                                                   WhereDefined.Database, AuthorizationType.Allow, _
                                                                  IIf(FromDate = Nothing, New DateTime(2006, 1, 1), FromDate), _
                                                                  IIf(ToDate = Nothing, New DateTime(9999, 12, 31), ToDate))
            Return True
        End Function

But there is no function with the name "DeleteAuthorization" .

i did not find anything in Documentation and other Discussions.

Regards Shaahin.

Feb 23, 2011 at 9:33 AM


before you must retrieve the Authorization (IAzManAuthorization).

Then … invoke the IAzManAuthorization.Delete() method.



Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail Web