Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Admin module #676

Merged
merged 1 commit into from
Jul 25, 2015
Merged

Admin module #676

merged 1 commit into from
Jul 25, 2015

Conversation

rhutchison
Copy link
Contributor

Supersedes #615

@mleanos
Copy link
Member

mleanos commented Jul 23, 2015

@rhutchison Did you see my comment in #615? I think we should go with this implementation. It really is clean, and extendable. My reservations have been addressed. I read through your conversation with @trainerbill, and I saw the light 😄

LGTM

@codydaig
Copy link
Member

@rhutchison Overall, I like it.

My only question right now is:
Any particular reason that we don't allow administrators to change the email field?

@rhutchison
Copy link
Contributor Author

@codydaig I see no reason not to - just wasn't apart of the original design. I can see many areas to improve the admin functions once we get this merged.

@lirantal @ilanbiala any concerns with this PR? Can probably close #615 at this point.

@codydaig
Copy link
Member

@rhutchison Sounds Good!

Tested and LGTM

user.firstName = req.body.firstName;
user.lastName = req.body.lastName;
user.roles = req.body.roles;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be updating the displayName here as well?

Perhaps, it's a decision for the developer user of this project. I can see some developers preferring to keep this data in the hands of the app user. I'm fine with this method updating the displayName; after all, it is an admin that's doing the update. They always know best.

@mleanos
Copy link
Member

mleanos commented Jul 24, 2015

I noticed that the Admin routes are still accessible to a user without the 'admin' role.

I saw the discussion in #686. I think this could be extended for this purpose. What have you come up with so far on the client-side roles/security?

@lirantal
Copy link
Member

We obviously need to fix security issues if exists here. I saw #686 but that's client side which is "tolerable" unlike if it's an actual security problem on the backend where roles/functions can be tempered with.

@rhutchison thanks a lot for the work here, please ping when we have all issues addressed and let's merge it in.

@mleanos
Copy link
Member

mleanos commented Jul 24, 2015

@lirantal I should have clarified. The client routes are still accessible, when manually typed into the browser address bar. The API routes return a proper 403 Forbidden response. We seem to be good on the backend security with this.

@rhutchison
Copy link
Contributor Author

@lirantal the back-end is secure, the front-end routes are not secure. This has been mentioned even prior to the introduction of an admin module - with articles.

#686 does not completely address the problem. What we need is better client-side (role-based) security implementation. This needs to be addressed in a separate PR.

If you merge #686 ahead of this commit, I will update this PR to follow that approach.

@trainerbill
Copy link
Contributor

Haha. I knew this was going to come up. The backend is secure as no REST calls can be made. All a user can do is get to the page, but not do anything. I had the same problem with angular-fullstack-generator in the past and solved it with this commit: trainerbill/generator-angular-fullstack@7d192a3 Basically it allowed you to put an authorize: 'admin' on the state which got check on statechangestart in ui.router. I am guessing we could take the same approach and was actually going to look into it.

update displayName

implements meanjs#700 (client-side role security) on angular routes.
@mleanos
Copy link
Member

mleanos commented Jul 25, 2015

LGTM. Very good work done here. Excited to merge this into my project. No more need to manually handle this.

@lirantal
Copy link
Member

Great work guys.
@rhutchison do we need to make any changes to this PR since we already merged #686 ?

@mleanos
Copy link
Member

mleanos commented Jul 25, 2015

@rhutchison I notice both this PR and merged #686 both define the client routes with the 'admin' role. @lirantal Is this what you're referring to? This could cause conflicts when merging this in.

@lirantal
Copy link
Member

@mleanos I was referring in general to the fact that we should just make sure that merging this in won't cause any troubles since #686 is already merged.

With regards to the routes there specifically, both this PR and #686 are making the same change so I don't see any "code" problem or conflict to merge.

@rhutchison
Copy link
Contributor Author

@lirantal we closed #686 and merged #700. This PR was updated to reflect the implementation of #700 and is ready to merge.

@lirantal
Copy link
Member

Got it. Merging.

lirantal added a commit that referenced this pull request Jul 25, 2015
@lirantal lirantal merged commit e1ca1aa into meanjs:0.4.0 Jul 25, 2015
@lirantal lirantal mentioned this pull request Jul 26, 2015
14 tasks
@rmlopes
Copy link

rmlopes commented Aug 7, 2015

Hi guys,

I am taking 0.4.0 for a ride and I think something is missing but maybe is on the todo list: shouldn't the app be seeded with an admin user now that the module exists? (I am just asking this since it is common practice in other frameworks)

@codydaig
Copy link
Member

codydaig commented Aug 7, 2015

@rmlopes That's a great point. Would you mind Opening up an issue about this? Since this is closed, discussion is bound to get missed.

@lirantal
Copy link
Member

lirantal commented Aug 7, 2015

it's a good point although we don't want meanjs to become a cms/platform but rather keep it lean and agile for anyone to kickstart a project.

I think I remember the meanjs generator had the option to create user/roles, no? (I might be confusing it with meanio)

@codydaig
Copy link
Member

codydaig commented Aug 7, 2015

@lirantal How about adding a line in the getting started position of the documentation with the mongo command to add the admin role to a user?

@lirantal
Copy link
Member

lirantal commented Aug 7, 2015

I'm open to suggestions. Let's continue this in a new User Roles discussion though, would you care to open the issue and let's move it there?

@trainerbill
Copy link
Contributor

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

Successfully merging this pull request may close these issues.

7 participants