You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Igor Bondarenko <je...@gmail.com> on 2015/06/01 17:07:59 UTC

[allura:tickets] #7633 API for has_access

- **status**: in-progress --> review
- **Comment**:

I did write the documentation for this, but forgot to post it :)

Here it is:

~~~~~
Permissions


This is API to run permission checks. It is available on a neighborhood, project and tool level.

Endpoints: 

- Neighborhood: `/rest/p/has_access`
- Project: `/rest/p/project_name/has_access`
- Tool: `/rest/p/project_name/mount_point/has_access`

It is only available to users that have 'admin' permission for corresponding neighborhood/project/tool.  It requires `user` and `perm` parameters and will return JSON dict with `result` key, which contains boolean value, indicating if given `user` has `perm` permission to the neighborhood/project/tool.

E.g.:

- `GET /rest/p/test/wiki/has_access?user=admin1&perm=create`
    - returns `{ result: true }`
- `GET /rest/p/test/wiki/has_access?user=user01&perm=create`
    - returns `{ result: false }`
~~~~~
 

I agree that test are repetitive, I'll try to refactor this kind of stuff in the future.  If you ok with these tests as it is you can close the ticket.



---

** [tickets:#7633] API for has_access**

**Status:** review
**Milestone:** unreleased
**Labels:** allura-api 42cc sf-current sf-2 
**Created:** Thu Aug 21, 2014 06:25 PM UTC by Dave Brondsema
**Last Updated:** Fri May 29, 2015 07:11 PM UTC
**Owner:** Igor Bondarenko

It would be useful to have an API to run `has_access` permission checks so that 3rd-party clients can rely on Allura permissions.   I think that it would be an API per-tool and per-project including neighborhood-projects (whose API needs some fixing) and that you would need 'admin' access on the project to use the API.  It could take a username and role and return a true/false result.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.