def __init__(self): ServicesHook.__init__(self) self.name = 'mumble' self.urlpatterns = urlpatterns self.service_url = settings.MUMBLE_URL self.access_perm = 'mumble.access_mumble' self.service_ctrl_template = 'registered/mumble_service_ctrl.html'
def m2m_changed_group_permissions(sender, instance, action, pk_set, *args, **kwargs): logger.debug("Received m2m_changed from group %s permissions with action %s" % (instance, action)) if instance.pk and (action == "post_remove" or action == "post_clear"): logger.debug("Checking if service permission changed for group {}".format(instance)) # As validating an entire groups service could lead to many thousands of permission checks # first we check that one of the permissions changed is, in fact, a service permission. perms = Permission.objects.filter(pk__in=pk_set) got_change = False service_perms = [svc.access_perm for svc in ServicesHook.get_services()] for perm in perms: natural_key = perm.natural_key() path_perm = "{}.{}".format(natural_key[1], natural_key[0]) if path_perm not in service_perms: # Not a service permission, keep searching continue for svc in ServicesHook.get_services(): if svc.access_perm == path_perm: logger.debug("Permissions changed for group {} on " "service {}, re-validating services for groups users".format(instance, svc)) def validate_all_groups_users_for_service(): logger.debug("Performing validation for service {}".format(svc)) for user in instance.user_set.all(): svc.validate_user(user) transaction.on_commit(validate_all_groups_users_for_service) got_change = True break # Found service, break out of services iteration and go back to permission iteration if not got_change: logger.debug("Permission change for group {} was not service permission, ignoring".format(instance))
def validate_all_services(): logger.debug("Validating all services for user {}".format(instance)) for svc in ServicesHook.get_services(): try: svc.validate_user(instance) except: logger.exception( 'Exception running validate_user for services module {} on user {}'.format(svc, user))
def validate_all_services(): logger.debug("Validating all services for user {}".format(instance)) for svc in ServicesHook.get_services(): try: svc.validate_user(instance) except: logger.exception( 'Exception running validate_user for services module {} on user {}'.format(svc, instance))
def validate_services(self, user): logger.debug('Ensuring user %s has permissions for active services'.format(user)) # Iterate through services hooks and have them check the validity of the user for svc in ServicesHook.get_services(): try: svc.validate_user(user) except: logger.exception('Exception running validate_user for services module %s on user %s' % (svc, user))
def trigger_service_group_update(): logger.debug("Triggering service group update for %s" % instance) # Iterate through Service hooks for svc in ServicesHook.get_services(): try: svc.validate_user(instance) svc.update_groups(instance) except: logger.exception('Exception running update_groups for services module %s on user %s' % (svc, instance))
def validate_services(self, user): logger.debug( 'Ensuring user %s has permissions for active services'.format(user)) # Iterate through services hooks and have them check the validity of the user for svc in ServicesHook.get_services(): try: svc.validate_user(user) except: logger.exception( 'Exception running validate_user for services module %s on user %s' % (svc, user))
def __init__(self): ServicesHook.__init__(self) self.name = 'mumble' self.urlpatterns = urlpatterns self.service_url = settings.MUMBLE_URL
def __init__(self): ServicesHook.__init__(self) self.name = 'ipboard' self.service_url = settings.IPBOARD_ENDPOINT self.urlpatterns = urlpatterns self.access_perm = 'ipboard.access_ipboard'
def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.service_url = 'http://exampleservice.example.com'
def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.name = 'seat' self.service_url = settings.SEAT_URL self.access_perm = 'seat.access_seat'
def __init__(self): ServicesHook.__init__(self) self.name = 'ipboard' self.service_url = settings.IPBOARD_ENDPOINT self.urlpatterns = urlpatterns
def __init__(self): ServicesHook.__init__(self) self.name = 'ips4' self.urlpatterns = urlpatterns self.service_url = settings.IPS4_URL self.access_perm = 'ips4.access_ips4'
def __init__(self): ServicesHook.__init__(self) self.name = 'openfire' self.urlpatterns = urlpatterns self.service_url = settings.JABBER_URL self.access_perm = 'openfire.access_openfire'
def __init__(self): ServicesHook.__init__(self) self.name = 'xenforo' self.urlpatterns = urlpatterns self.access_perm = 'xenforo.access_xenforo'
def __init__(self): ServicesHook.__init__(self) self.name = 'smf' self.urlpatterns = urlpatterns self.service_url = settings.SMF_URL
def __init__(self): ServicesHook.__init__(self) self.name = 'mumble' self.urlpatterns = urlpatterns self.service_url = settings.MUMBLE_URL self.access_perm = 'mumble.access_mumble'
def __init__(self): ServicesHook.__init__(self) self.name = 'phpbb3' self.urlpatterns = urlpatterns self.service_url = settings.FORUM_URL # TODO: This needs to be renamed at some point... self.access_perm = 'phpbb3.access_phpbb3'
def __init__(self): ServicesHook.__init__(self) self.name = 'market' self.urlpatterns = urlpatterns self.service_url = settings.MARKET_URL self.access_perm = 'market.access_market'
def __init__(self): ServicesHook.__init__(self) self.name = 'phpbb3' self.urlpatterns = urlpatterns self.service_url = settings.FORUM_URL # TODO: This needs to be renamed at some point...
def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.name = 'slack' self.service_url = settings.SLACK_URL self.access_perm = 'slack.access_slack'
def __init__(self): ServicesHook.__init__(self) self.name = 'smf' self.urlpatterns = urlpatterns self.service_url = settings.SMF_URL self.access_perm = 'smf.access_smf'
def __init__(self): ServicesHook.__init__(self) self.name = 'teamspeak3' self.urlpatterns = urlpatterns self.service_ctrl_template = 'registered/teamspeak3_service_ctrl.html'
def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.name = 'discord' self.service_ctrl_template = 'registered/discord_service_ctrl.html'
def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.name = 'discord' self.service_ctrl_template = 'registered/discord_service_ctrl.html' self.access_perm = 'discord.access_discord'
def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.name = 'discourse' self.service_ctrl_template = 'registered/discourse_service_ctrl.html' self.access_perm = 'discourse.access_discourse'