How to achieve authorize the pages in MEAN stack web application using Mongoose and MongoDB?

6 views
Skip to first unread message

charan tej

unread,
Mar 1, 2017, 8:25:58 AM3/1/17
to Mongoose Node.JS ODM

I am being writing the schema for the Application in mongodb. Usually in asp.net with Sql, We have assigned the pages/UIs to each roles which means role have the permission (view/edit) to access the page or not. When the role login to the Application he can only view/Edit in assigned pages to that role, un assigned pages will not be shown for that role.


In c# i have restrict the role with write the code in pre_init event. In MEAN Stack application, the same I am trying with the mongoDB.


var mongoose = require('mongoose'),
    Schema = mongoose.Schema;    


var rolesSchema = new Schema({
    role: { name: String },
    accessPage: { pagename: String, view: true, Edit: true }
});


var roles= mongoose.model('roles', rolesSchema );


I'm new to MEAN stack, How we can achieve the authorisation related stuffs in MEAN stack web application.



Reply all
Reply to author
Forward
0 new messages