Add ACLs with Google Authentication

I would like to implement ACLs with Google Authentication. We need some kind of pointer regarding the possibility of the same.

Use Case:

  • Page X is only available for myadmin@gmail.com

  • The Y page, accessible to everyone, belongs to group Y. After registration, the moderator will add / reject a user to group Y.

  • Pages are not available if the user does not belong to either of the two above. Unauthorized submission is prohibited even if the user has successfully authenticated.

I plan to use Django for my project, any support provided by Django will be helpful.

Thanks in advance.

+3
source share
2 answers

: ACL , user_id, . API- .

+5

, :

app.yaml:

handlers:
- url: /admin/.*
  script: main.py
  login: admin

- url: /super-restricted-area/.*
  script: main.py
  login: admin

URL- admin super-restricted-area . URL-, . Python Application Configuration doc, .

, Django, , , . , , django ( , django ) .

, :

from google.appengine.api import users

user = users.get_current_user()

if user:
    # Get the group of the user and perform your authorisation

.

0

All Articles