play-project / play

The main repository, used for website and issues
2 stars 0 forks source link

Add permission-checking service to Governance #54

Closed stuehmer closed 11 years ago

stuehmer commented 11 years ago

I need a permission-checking service so that I can validate users from other endpoints.

API should include: Input: UserURI, StreamURI, Mode Output: boolean allowed/disallowed

Input: Token, StreamURI, Mode Output: boolean allowed/disallowed

This can be used by other Web portals and services which must enforce PLAY permissions.

chamerling commented 11 years ago

Do you need it at REST API level (ie user with OAuth token stuff) or at SOAP one?

Then:

stuehmer commented 11 years ago

token: your governance user-token useruri: the resource of the user (generated in PLAY.me if I am correct)

chamerling commented 11 years ago
stuehmer commented 11 years ago
chamerling commented 11 years ago
stuehmer commented 11 years ago

On 26.06.2013 16:51, Christophe Hamerling wrote:

  • useruri: The user has a list of groups he belongs to. In the list a group is a URI. The permission is a resource which contains the agents (ie group).

ok, then this is not useful I think. let's only have the solution below:

  • token: this will works for current user. Is it what you need ie "I want to check if I can access to a stream in a given mode"

yes, exactly what I need

chamerling commented 11 years ago

@stuehmer what will you use for role as operation input?

or simple values (read, write, ...) ?

chamerling commented 11 years ago

WDYT about this:

    /**
     * Check is the user can access to the stream in the given mode.
     *
     * @param id
     * @param mode
     * @return HTTP 200 OK if access is authorized, else HTTP 403 unauthorized
     */
    @GET
    @Path("/{id}/access/{mode}")
    @Produces(MediaType.APPLICATION_JSON)
    Response checkAccess(@PathParam("id") String id, @PathParam("mode") String mode);

with mode = read/write/... (without URL)

stuehmer commented 11 years ago