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

PermPermissionStore has no method define Permission #432

Open
iamdeadman opened this issue Aug 6, 2017 · 0 comments
Open

PermPermissionStore has no method define Permission #432

iamdeadman opened this issue Aug 6, 2017 · 0 comments

Comments

@iamdeadman
Copy link

iamdeadman commented Aug 6, 2017

Hi,

I had tried angular-permission in one of my previous projects with version 2.3.8 I believe and It was working fine.
Now, while setting up a new project with the updated newest version we are getting -
79 Uncaught TypeError: PermPermissionStore.definePermission is not a function

for the setup

  1. I used the unminified files from "bower install angular-permission" (angular-permission.js, angular-permission-ui.js)
  2. defined 'permission', 'permission.ui' in app modules.
var altairApp = angular.module('altairApp', [
    'ui.router',
    'oc.lazyLoad',
    'ngSanitize',
    'ngRetina',
    'ncy-angular-breadcrumb',
    'ConsoleLogger',
    'ngResource',
    'ngCookies',
    'permission',
    'permission.ui'
]);

Now in the app run block when I am trying to setup dynamic permissions from server like this -

PermPermissionStore.definePermission('anonymous', function ($stateParams) {
        var deferred = $q.defer();
        Auth.isLoggedInAsync(function(cb){
            if (cb && cb == true) deferred.reject();
            else deferred.resolve();
        });
        return deferred.promise;
    });

Where Auth service handles the logic for authenticating / retrieving role info from server.
Now, I am getting that definePermissions is not a function.

[Note: I am not including the dependencies (permissions.js / permissions-ui.js) as is in the body / head section of my index.html. But, passing these to my gulp pipeline for minification and concatenation into one single deps file for production, but I read in the issues section somewhere that minified versions might create / have some issues. So, to check this issue I did try to include them in the main index.html after my angular script definition, but got the same error again. ]

What might be the issue here, can anyone help me debug this issue.

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

1 participant