Grant service access by permissions (#692)

* Add service access permissions and migration

`ENABLE_AUTH_<servicename> = True` will have the new permission applied
to the settings configured `DEFAULT_AUTH_GROUP` group or `Member` if
none is configured.

`ENABLE_BLUE_<servicename> = True` will have the new permission applied
to the settings configured `DEFAULT_BLUE_GROUP` group or `Blue` if none
is configured.

* Move views and hooks to permissions based access

* Remove access restriction to services view

Hypothetically non-member/blues could be granted permission to access
services manually as desired now. A user that has no permissions to
access any services will see a blank services list.

* Remove obsolete service settings

* Remove references to obsolete settings

* Adjusted tests to support permissions based access

* Fix incorrectly named permissions

* Add simple get_services generator function

* Added signals for user and groups perm changes

* Update validate_services to support permissions

deactivate_services removed as its surplus to requirements.

* Removed state parameter from validate_services calls

* Update tests to support signals changes

* Fix incorrect call to validate_services task

* Fix validate_services and test

* Add validate_user to changed user groups signal

* Added tests for new signals

* Remove unnecessary post_add signals

* Added documentation for service permissions

* Added detection for members with service active

If there are any service users in the Member or Blue groups active, then
the permission will be added to the respective Member or Blue group.
This means its no longer necessary to maintain the service enablesettings to migrate to permissions based service.

Remove obsolete state based status checking
This commit is contained in:
Basraah
2017-02-12 13:51:30 +10:00
committed by Adarnof
parent 58e121d10d
commit a33c8c14ee
80 changed files with 1192 additions and 496 deletions

View File

@@ -47,34 +47,6 @@ When changing these booleans, edit the setting within the brackets (eg `('AA_MEM
- OAuth callback URL. Should be `https://mydomain.com/sso/callback`
## Services
### Member Services
After installing services, enable specific services for members by setting the following to `True`
- [ENABLE_AUTH_FORUM](#enable-auth-forum)
- [ENABLE_AUTH_JABBER](#enable-auth-jabber)
- [ENABLE_AUTH_MUMBLE](#enable-auth-mumble)
- [ENABLE_AUTH_IPBOARD](#enable-auth-ipboard)
- [ENABLE_AUTH_TEAMSPEAK3](#enable-auth-teamspeak3)
- [ENABLE_AUTH_DISCORD](#enable-auth-discord)
- [ENABLE_AUTH_DISCOURSE](#enable-auth-discourse)
- [ENABLE_AUTH_IPS4](#enable-auth-ips4)
- [ENABLE_AUTH_SMF](#enable-auth-smf)
- [ENABLE_AUTH_MARKET](#enable-auth-market)
- [ENABLE_AUTH_XENFORO](#enable-auth-xenforo)
### Blue Services
After installing services, enable specific services for blues by setting the following to `True`
- [ENABLE_BLUE_FORUM](#enable-blue-forum)
- [ENABLE_BLUE_JABBER](#enable-blue-jabber)
- [ENABLE_BLUE_MUMBLE](#enable-blue-mumble)
- [ENABLE_BLUE_IPBOARD](#enable-blue-ipboard)
- [ENABLE_BLUE_TEAMSPEAK3](#enable-blue-teamspeak3)
- [ENABLE_BLUE_DISCORD](#enable-blue-discord)
- [ENABLE_BLUE_DISCOURSE](#enable-blue-discourse)
- [ENABLE_BLUE_IPS4](#enable-blue-ips4)
- [ENABLE_BLUE_SMF](#enable-blue-smf)
- [ENABLE_BLUE_MARKET](#enable-blue-market)
- [ENABLE_BLUE_XENFORO](#enable-blue-xenforo)
### IPBoard
If using IPBoard, the following need to be set in accordance with the [install instructions](../services/ipboard3.md)
- [IPBOARD_ENDPOINT](#ipboard-endpoint)