Changeset 7658


Ignore:
Timestamp:
16 Feb 2012, 15:29:13 (13 years ago)
Author:
Henrik Bettermann
Message:

Do not edit roles if nothing has changed.

Convert role to ASCII string to be in line with the event handler. Otherwise we have a mixture of ASCII and unicode strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/authentication.py

    r7636 r7658  
    180180        prm = get_principal_role_manager()
    181181        old_roles = self.getSiteRolesForPrincipal()
     182        if sorted(old_roles) == sorted(roles):
     183            return
    182184        for role in old_roles:
    183185            # Remove old roles, not to be set now...
     
    185187                prm.unsetRoleForPrincipal(role, self.name)
    186188        for role in roles:
    187             prm.assignRoleToPrincipal(role, self.name)
     189            # Convert role to ASCII string to be in line with the
     190            # event handler
     191            prm.assignRoleToPrincipal(str(role), self.name)
     192        return
    188193
    189194    roles = property(getSiteRolesForPrincipal, setSiteRolesForPrincipal)
Note: See TracChangeset for help on using the changeset viewer.