Questions tagged [sails-permissions]

Sails Permissions is an addon for the Sails.js Framework (sailsjs.org). It is a comprehensive user permissions and entitlements system for sails.js and Waterline. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.

9 questions
8
votes
1 answer

sails-permissions getting all permissions

I am trying to send all the permissions for an authenticated user via JSON from Sails. My current code to find permissions for a single model type: hasPermission: function hasPermission(req, res) { var permitted =…
BeaverusIV
  • 988
  • 1
  • 11
  • 26
5
votes
1 answer

How to redirect in sails after login with sails-permissions

I've just started using sails and am trying to implement authentication. I installed everything like adviced, then created a simple login form with jade: form(action="/auth/local", method="post") div input(name="identifier"…
user5181073
3
votes
1 answer

Populated association fields on find route with blueprint option ON

My app has a "Categories" model. Categories can be children of other categories. So there is a "CategoriesAssociations" model. Here is the code : /* api/models/Categories.js */ module.exports = { attributes: { name: { type: "string" …
Armel Larcier
  • 15,747
  • 7
  • 68
  • 89
2
votes
1 answer

Sails project - mysql connection 'Error: Consistency violation'

I have created a new sails project and installed sails-permission. First it worked fine. After creating connection to Mysql and did sails lift it throws an error as error: Error: Consistency violation: A model (`passport`) references a datastore…
San Daniel
  • 165
  • 1
  • 3
  • 15
1
vote
3 answers

how to implement permissions on routes and functions in sails.js?

I'm new in sails and I have a PostgreSQL database. I want to implement a user management. I have some users, each user can be assigned to multiple groups, each group can be assigned to multiple roles and each role can have some permissions! I…
fariba.j
  • 1,737
  • 7
  • 23
  • 42
1
vote
2 answers

How can I apply a policy to homepage in Sails?

I want to apply a policy that lets user to login to application. I written the code for policy. I want to apply this one to homepage also. I tried below in policies.js but its not working on homepage. '*' : 'isLoggedIn'
Mahesh B
  • 143
  • 2
  • 13
1
vote
1 answer

sails-permissions grant not working with criteria

I have setup sails permissions and its working well. I only seem to have an issue when trying to grant a role access to read on a criteria. Exact what I am trying to achieve is the following: - Users in role Public should be able to read / view any…
f9051433
  • 11
  • 1
1
vote
1 answer

Nested Models and controllers in sails are not working Policies

Continuation of this bug : API Versioning in SailsJS Sails Permissions AuditPolicy is not working properly. can any one guide me to do. O/P: error: Sending 500 ("Server Error") response: Error: Invalid route option, "model". I don't know…
Ayyappa A
  • 657
  • 3
  • 8
  • 24
0
votes
0 answers

SailsJS: How to reset your policies in config/policies.js

We have a problem with Sails policies. Our default policy is: '*': [ 'basicAuth', 'passport', 'sessionAuth', 'ModelPolicy', 'AuditPolicy', 'UpdatedByPolicy', 'OwnerPolicy', 'OmniPolicy' ], But when I start the server is complains about another…
ChrisWorks
  • 207
  • 1
  • 4
  • 11