Comments (5)
The roles are: Admin, Manager, User ?
from five15.
I think those are fine until we find out that we need others.
from five15.
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.
from five15.
@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.
from five15.
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.
from five15.
Related Issues (17)
- Create Initial Project Code
- Test
- Javascript Closure AP Module HOT 4
- Add Jasmine Unit Tests To Build HOT 12
- Add JSHint to build
- Add JSCS to build
- Validate remainder of AnguarJS code against style guide HOT 6
- Stub NG service to retrieve prior reports
- Stub NG service to save reports
- Add state to create new report
- Add state to view prior report
- Send Basic Auth Request HOT 5
- Respond To Basic Auth Request
- Replace bower_components with gradle task
- Move common modules to five15.core HOT 1
- Swap out basic auth and profile service with spring-security-rest plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from five15.