New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User role based access for APIs #1165

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@pliablepixels
Contributor

pliablepixels commented Nov 17, 2015

@kylejohnson please review interim progress (Please label Not Ready to Merge) #1155

So far I've implemented user roles for the Monitors API. If this approach is ok, I'll continue down this path.

@pliablepixels pliablepixels changed the title from Implemented user based access for Monitors APIs to User role based access for APIs Nov 17, 2015

{
$options = array ('conditions' => array ('User.Username' => $loggedinUser));
$userMonitors = $this->User->find('first', $options);
$this->Session->Write('allowedMonitors',$userMonitors['User']['MonitorIds']);

This comment has been minimized.

@kylejohnson

kylejohnson Dec 2, 2015

Member

I haven't read up on this in a while, but what do you think of Session->Write vs. Configure::write? I am using the latter in other places.

@kylejohnson

kylejohnson Dec 2, 2015

Member

I haven't read up on this in a while, but what do you think of Session->Write vs. Configure::write? I am using the latter in other places.

This comment has been minimized.

@pliablepixels

pliablepixels Dec 5, 2015

Contributor

@kylejohnson , based on my reading:

Configure::write is for application wide variables while Session->Write is for settings that get set only for that specific session. The latter is what we need for these variables as they will change depending on who has opened the session

@pliablepixels

pliablepixels Dec 5, 2015

Contributor

@kylejohnson , based on my reading:

Configure::write is for application wide variables while Session->Write is for settings that get set only for that specific session. The latter is what we need for these variables as they will change depending on who has opened the session

@kylejohnson

This comment has been minimized.

Show comment
Hide comment
@kylejohnson

kylejohnson Dec 3, 2015

Member

Overall this looks pretty good.

Maybe I'm not reading the AppController class right - but how does a user actually log in to the API?

Member

kylejohnson commented Dec 3, 2015

Overall this looks pretty good.

Maybe I'm not reading the AppController class right - but how does a user actually log in to the API?

@pliablepixels

This comment has been minimized.

Show comment
Hide comment
@pliablepixels

pliablepixels Dec 5, 2015

Contributor

@kylejohnson - the user does not log into the API. The user logs into ZM. This sets a set of variables - I am accessing those variables in the context of the same session to make sure the user has logged in.

Contributor

pliablepixels commented Dec 5, 2015

@kylejohnson - the user does not log into the API. The user logs into ZM. This sets a set of variables - I am accessing those variables in the context of the same session to make sure the user has logged in.

@pliablepixels pliablepixels referenced this pull request Dec 19, 2015

Closed

api: more security #1195

@pliablepixels

This comment has been minimized.

Show comment
Hide comment
@pliablepixels

pliablepixels Dec 19, 2015

Contributor

I'm closing this as PR #1196 supersedes this and adds OPT_API to UI too

Contributor

pliablepixels commented Dec 19, 2015

I'm closing this as PR #1196 supersedes this and adds OPT_API to UI too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment