authorization

Rails object based permission/authorization engine?

♀尐吖头ヾ 提交于 2019-12-30 12:23:06
问题 I want to add "Sharing documents" feature to my app, like in google documents service. As i see: User can: can list/view/create/edit/delete own documents share own document to everyone - its a public document share own document to another user with read-only access share own document to another user with read-write access view list of own documents and users to whom he gave permission to read and write view list of foreign documents view/edit foreign document with read/write permissions

ASP.NET MVC: Can I say [Authorize Roles=“Administrators”] on the Controller class, but have one public action?

孤人 提交于 2019-12-30 09:47:51
问题 I started off using the default project's AccountController , but I've extended/changed it beyond recognition. However, in common with the original I have a LogOn and LogOff action. Clearly, the LogOn action must be accessible to everyone. However, since I've added lots of other actions to this controller (to create & edit users), I want 99% of the actions to require administrator role membership. I could decorate all my actions with [Authorize Roles="Administrators"] but there's a risk I'll

Custom form authentication / Authorization scheme in ASP.net MVC

寵の児 提交于 2019-12-29 13:30:34
问题 I am trying to create a custom authentication scheme in ASP.NET MVC using form authentication. The idea that I might have different areas on the site that will be managed - approver are and general user area, and these will use different login pages, and so forth. So this is what I want to happen. User access restricted page (right now I have it protected with a customer AuthorizeAttribute) User is redirected to a specific login page (not the one from Web.config). User credentials are

Android: Google Maps Android API: Authorization failure

狂风中的少年 提交于 2019-12-29 08:05:30
问题 When my app tries to use the Google Maps API, I get the following logcat error as soon as I try to access Google Map API data (scroll right to see the good stuff!): 02-02 15:39:35.329 23868-24511/com.somepackage.name E/Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map. 02-02 15:39:35.339 23868-24511/com.somepackage.name E/Google Maps Android API: Ensure that the following correspond to

Defer Angular UI Router $stateChangeStart until server authorization response receieved

我与影子孤独终老i 提交于 2019-12-29 05:57:31
问题 I have an Angular app using UI Router where I'm trying to validate a user's token, if one exists, when the app runs. I am also checking that the user has permission to access certains routes. The problem is that $stateChangeStart is running before I receive the response back from the authorization endpoint. Here's some code (coffeescript with js below) - this is all within my run block. app.run(($rootScope, $state, $stateParams, $log, Auth) -> currentState = 'home' $rootScope.$state = $state

How to Authorize AD users with .Net Core

末鹿安然 提交于 2019-12-29 04:29:06
问题 I'm trying to stop requests on a route using the Authorize annotation, but I can't get it to work with Active Directory. Had anyone got this working yet? [HttpGet] [Authorize(Roles = "DOMAIN\\Group A")] [Route("/")] // GET: / public IActionResult Index() { return View(); } Note: I've also tried Authorize(Roles = @"DOMAIN\\Group A") Just to give some background, I'm running Windows, Visual Studio Pro 2015 (Update 3) Heres a bit from my project.json file: "dependencies": { "Microsoft.AspNetCore

How to Authorize AD users with .Net Core

时光怂恿深爱的人放手 提交于 2019-12-29 04:28:33
问题 I'm trying to stop requests on a route using the Authorize annotation, but I can't get it to work with Active Directory. Had anyone got this working yet? [HttpGet] [Authorize(Roles = "DOMAIN\\Group A")] [Route("/")] // GET: / public IActionResult Index() { return View(); } Note: I've also tried Authorize(Roles = @"DOMAIN\\Group A") Just to give some background, I'm running Windows, Visual Studio Pro 2015 (Update 3) Heres a bit from my project.json file: "dependencies": { "Microsoft.AspNetCore

Flask redirect with authentication

China☆狼群 提交于 2019-12-25 16:09:24
问题 In Flask, how would I redirect AND provide credentials. For example: redirect('http://url:5000', auth=(username, password)) 回答1: redirect(url_for('.view_function', username=username, password=password)) These parameters can then be accessed as parameters passed to your view function. However, this isn't the right way to keep a track authorization (I'm assuming that is what you're trying to do here). Your information could easily be breached as all credentials (including the password) would be

Folder authorization in asp.net Identity 2.1

陌路散爱 提交于 2019-12-25 12:04:09
问题 I searched but couldn't find role based authorization for access to folders or files in .net identity 2.1 as there is in form based authorization <location path="Pictures"> <system.web> <authorization> <allow roles="Administrators"/> //Allows users in Admin role <deny users="*"/> // deny everyone else </authorization> </system.web> </location> Is there any way to implement this in .net identity? 回答1: You can write a filter: public class FilterStaticFilesAttribute :

Folder authorization in asp.net Identity 2.1

六眼飞鱼酱① 提交于 2019-12-25 12:03:54
问题 I searched but couldn't find role based authorization for access to folders or files in .net identity 2.1 as there is in form based authorization <location path="Pictures"> <system.web> <authorization> <allow roles="Administrators"/> //Allows users in Admin role <deny users="*"/> // deny everyone else </authorization> </system.web> </location> Is there any way to implement this in .net identity? 回答1: You can write a filter: public class FilterStaticFilesAttribute :