Where to apply ACLS in Angularjs

BACKGROUND

I have created an application that users can log into then look up customer information

WHAT I AM TRYING TO DO

Restrict access to various routes based upon the permissions of the user.

WHERE I AM UP TO

I am using:

ui-router - for routing

ng-token-auth (https://github.com/lynndylanhurley/ng-token-auth) - for handing authentication

angular-acl (https://github.com/mikemclin/angular-acl) - for handling permissions.

MY ISSUE

When the user logs in, the 'auth:validation-success' event is broadcasted. I use this event to populate the aclProvider with the user permissions data returned from the authProvider then on the route I use the resolve method to check if the user has permissions to view it.

Which is perfect however...

When I refresh the page I loose the user stored in the authProvider and the permissions stored in the AclProvider. By default the authProvider will re-authenticate on page refresh, returning the user data but the resolve method always fires first and therefore the permissions don't exist because they haven't been read from the user...

How can I fix this?

Category:angularjs Views:0 Time:2018-08-10

Related post

  • SQL - Selecting with WHERE that applies to multiple rows 2011-06-30

    I am at a loss on how to write this query or even how to explain it - basically I am trying to have a WHERE clause apply to multiple rows. I have a table like so: RuleID QuestionID AnswerID ================================= 1 1100 1105 1 1200 1205 1

  • Where are the ACL permissions being checked when a file is about to be opened in EXT2? 2012-04-26

    In the EXT2 file.c the open file operation (.open) is being pointed to dquot_file_open which furthur points to generic_file_open which is present in fs/open.c. The generic_file_open looks like it just has the below code int generic_file_open(struct i

  • screen resolution menu won't show the bottom where the apply & ok check boxes are located 2012-08-23

    my screen reolution is set at maximum but if i want to change it i can;t get to the bottom where the apply & ok check boxes are. I also can not reach the bottom of my windows media picture print bottom to check the print box lI have windows vista

  • hi. i'm going to college this september and i'd like to know if it's possible to do my work experience in the microsoft company in dublin. and what to do and where to apply. thanks 2013-12-03

    the name of the course is: Cisco data networking hi. i'm going to college this september and i'd like to know if it's possible to do my work experience in the microsoft company in dublin. and what to do and where to apply. thanks --------------Soluti

  • Where to manage ACL inheritance? 2010-02-12

    Where should I best manage a hierarchy of ACLs? I see three possibilities to manage a hierarchy of ACLs: 1) The ACLs themselves manage the hierarchy: class Acl { Acl parent; // ... } 2) Constructing a separate tree structure to manage the hierarchy.

  • Where to Apply User Based Data-View Customizations? 2010-08-13

    I have a fairly large ASP.NET MVC 2 application that requires a large amount of user profile based data customization. This involves things like adding/removing table columns or applying user specific column headers in data returned by AJAX requests.

  • CakePHP ACL confusion, how do I apply ACLs to objects, not actions? 2010-02-08

    Can anyone suggest a scalable design pattern for implementing access control on Photos and Albums, each with individual privacy settings (i.e. owner, group member, public)? I'm using CakePHP, and the examples I have read on the ACL component seem to

  • How/Where to apply business rules to POCO objects? 2011-04-12

    Let's say I have a POCO with the following: [DataMember] public Nullable<int> MetricId { get { return _metricId; } set { if (_metricId != value) { _metricId = value; OnPropertyChanged("MetricId"); } } } private Nullable<int> _metricId; I

  • Is there a pre/post $apply hook in AngularJS? 2015-02-18

    I wish to run a callback function whenever $apply is called on a scope. Is there a pre/post $apply hook or some event that I can bind to, to achieve this? --------------Solutions------------- I don't know why You need that, but there is no pre/post $

  • When and where to implement ACL 2009-07-07

    I've got rails_authorization_plugin up and running with models. What's the best way to implement permission checks on my site? I have complicated conditions for when an instance of an object should be visible, is there an efficient way to chain them

  • Where to apply logic for a sidebar control in ASP.NET MVC 2010-01-11

    Take the example of wanting to have a "Latest news items" sidebar on every page of your ASP.NET MVC web site. I have a NewsItemController which is fine for pages dedicating their attention to NewsItems. What about having a news sidebar appear on the

  • WPF - FocusVisualStyle where do i apply it? 2009-03-23

    I have a UserControl which basically wraps a ListBox like this - <ListBox x:Name="lb" ItemsSource="{Binding ElementName=UC,Path=Pages}" Background="{Binding ElementName=UC,Path=Background}" BorderBrush="Transparent" ScrollViewer.CanContentScroll="

  • How to apply Where clause to secondary table 2011-05-17

    I have an Entity created with a main table and 2 associated tables. I joined the primary-secondary tables using the hibernate annotations. Here is the code. @Entity @Table(name = "Table1") @org.hibernate.annotations.Entity(dynamicUpdate=true) @org.hi

  • Detect where applied to IQueryable 2011-10-26

    How can I detect if a IQueryable<T> has a where filter applied? In this code, I need to know programmatically that queryFiltered has a where applied to it and query doesn't IQueryable<Customer> query = Context.Customers; IQueryable<Cus

  • Symfony2: should ACL be applied to child entities aswell? 2012-02-25

    I have this entity structure: Apartment -> Floor (one to many) Floor -> LeaseTerm (one to many) I'm applying ACL to Apartment entity on persist (owner). My question is, should i bother applying ACL to Floor and LeaseTerm entites aswell, or shou

  • How can I apply authenticated proxy exceptions to an opener using urllib2? 2008-11-07

    When using urllib2 (and maybe urllib) on windows python seems to magically pick up the authenticated proxy setting applied to InternetExplorer. However, it doesn't seem to check and process the Advance setting "Exceptions" list. Is there a way I can

  • What's the difference between HAVING and WHERE? 2008-11-13

    I must be googling in the wrong way or I'm having a stupid moment in time. What's the difference between HAVING and WHERE in an SQL SELECT statement? EDIT: I've marked Steven's answer as the correct one as it contained the key bit of information on t

  • Where can I learn the basics of game physics and the math behind it? 2009-07-11

    I taken math in college (trigonometry, calculus II...) but I don't know why you use tan, arctan, etc., in game physics. I know I can find working code and understand everything except why I am using a particular trig function, but I don't want that.

  • When should I use Cross Apply over Inner Join? 2009-07-16

    What is the main purpose of using CROSS APPLY? I have read (vaguely, through posts on the Internet) that cross apply can be more efficient when selecting over large data sets if you are partitioning. (Paging comes to mind) I also know that CROSS APPL

  • tr:nth-child(even) help. how to apply to one class? 2009-10-15

    im not very good with css and i need some help. i have a table where i want every other row to be gray and the alternating rows to be white. but i only want it to happen on one particular table. i added some code to my css: tr:nth-child(even) { backg

  • NHibernate mapping. Set collection of joined-subclass declared elements and the where property 2010-02-23

    I am working on a project where persisted data can be flagged for deletion, but remains in the database having a column (is_deleted) set to TRUE. This works fine using the hibernate class mapping property "where" and adding where="is_deleted = 0" to

  • Query Execution Plan - When is the Where clause executed? 2010-05-24

    I have a query like this (created by LINQ): SELECT [t0].[Id], [t0].[CreationDate], [t0].[CreatorId] FROM [dbo].[DataFTS]('test', 100) AS [t0] WHERE [t0].[CreatorId] = 1 ORDER BY [t0].[RANK] DataFTS is a full-text search table valued function. The que

  • Advantage database throws an exception when attempting to delete a record with a like statement used in the where clause 2010-06-01

    The code below shows that a record is deleted when the sql statement is: select * from test where qty between 50 and 59 but the sql statement: select * from test where partno like 'PART/005%' throws the exception: Advantage.Data.Provider.AdsException

  • SQL: using WHERE AND instead of HAVING 2010-07-01

    here's an example of a SQL statement where we use HAVING: select column1 from table1 where condition1 having condition2; isn't it the same exact thing if we do this: select column1 from table1 where condition1 AND condition2; what is the difference b

  • Why is this LINQ Where clause not returning results? 2010-09-03

    We have an entity with DateTime property DateDestroyed. A query needs to return results where this value is between nullable DateTimes startDate and endDate. The where clauses I have are: .Where(x => startDate.HasValue ? startDate <= x.DateDest

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.661 (s). 12 q(s)