Skip to content
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

Provide options to disable certain actions #26

Open
deanc opened this issue Dec 23, 2014 · 4 comments
Open

Provide options to disable certain actions #26

deanc opened this issue Dec 23, 2014 · 4 comments

Comments

@deanc
Copy link

deanc commented Dec 23, 2014

Hi,

I suggest providing global options to disable the following actions within SimpleUser:

  • Registration - some people might use SimpleUser to manage administration, but prefer to add users manually (or via database)
  • Login/logout - under certain circumstances it might be preferable to disable the ability to login/logout for anyone but administrators.
  • User list - many people might not want to show the full list of users. This is a security risk in fact, to show the full list of users (including admins)

I'm happy to work on a PR for this, let me know :)

@jasongrimes
Copy link
Owner

Hi Dean,

I like this idea.

I won't have a chance to follow up until the new year, but I'm planning to dig out of the backlog of issues on this project in mid-January.

Thanks for this (and the rest of your recent suggestions).

Jason

@WillGibson
Copy link

I'm just experimenting with silex-simpleuser for something at work and we would also need to be able to disable registration and the user list. Not sure where you guys got with this, but I'd be happy to pitch in on this during our spike day tomorrow.

@enzolutions
Copy link

Hi folks

I had a similar need to disable path = user/list to non Admin users, so I used the following configuration.

$app['security.access_rules'] = array(
  array('^/user/list', 'ROLE_ADMIN'),
);

After apply this is an anonymous try to access user/list is redirected to /user/login, if the user is logged but not admin user get the following error

Whoops, looks like something went wrong.

If I try to access with an Admin users the page is render properly.

About the error I am not sure why I am getting that error, could be the controller itself, but I didn't confirm yet. any help is accepted.

enzo

@deanc
Copy link
Author

deanc commented Jun 30, 2015

This obviously should be a configuration option further down the line, but I was wondering if we could simply over-ride the route. I couldn't get that working. Your solution is acceptable I think enzolutions for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants