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

Add Basic In Memory Auth #1

Closed
osscontributor opened this issue Jun 23, 2015 · 5 comments
Closed

Add Basic In Memory Auth #1

osscontributor opened this issue Jun 23, 2015 · 5 comments

Comments

@osscontributor
Copy link
Owner

We only need enough in place here to start building role based behavior in the app.

@JasonTypesCodes
Copy link
Collaborator

The roles are: Admin, Manager, User ?

@osscontributor
Copy link
Owner Author

I think those are fine until we find out that we need others.

@JasonTypesCodes
Copy link
Collaborator

Does this story include anything for the Grails side?

I've added some users to the angular side. Feel free to login as user:user, manager:manager, or admin:admin. Nothing spectacular happens yet, but I do have the 'report' state limited to accounts with the 'user' role.

@craigburke I extended the data field in the state config object to show what roles a state expects users to have to allow a transition to the next state. What do you think of this approach? It feels clean to me. I'm also curious about what I need to do to make use of the annotate and closure-wrap modules in the asset pipeline.

Let me know what you think.

@craigburke
Copy link
Collaborator

@VoltiSubito I really like what you did with the roles. Alternatively we could add an $http interceptor to redirect to $state('login') when we get a 403 response: https://docs.angularjs.org/api/ng/service/$http

I think I like your approach better though. It has the advantage of not requiring each state to have an http request to trigger the 403 and not triggering any requests at all before you are authenticated. We'll have some redundancy on the backend but I think it's really slick 👍

As for the asset pipeline stuff. I actually put a couple pull requests in to the asset pipeline core project to help with those two modules. The closure wrap will automatically wrap any js file with the directive option:

//= wrapped

As for the annotation we'll actually have a decision to make on that front. Basically it'll boil down to using my annotate plugin (which will just work out of the box) or getting much better build performance using the soon to be available angularPass compile setting in new version of AP. It's faster but we'll have to put a special comment before each function like this:

// @ngInject 
function FooController($scope) { 
...
}

So we'll just have to see which approach makes most sense.

@osscontributor
Copy link
Owner Author

We have a dummied up in memory thing now so I am going to go ahead and close this. We need to start building real auth but will track that as separate issues.

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

No branches or pull requests

3 participants