Questions tagged [access-control]
Access control is the process of limiting the access of ability of users or services to certain resources.
access-control
1,390
questions
284
votes
8
answers
275k
views
Prevent pushing to master on GitHub?
GitHub allows you to configure your repository so that users can't force push to master, but is there a way to prevent pushing to master entirely? I'm hoping to make it so that the only way of adding ...
219
votes
12
answers
70k
views
Role-based access control (RBAC) vs. Claims-based access control (CBAC) in ASP.NET MVC
What are the main benefits of using CBAC vs. RBAC? When is it better to use CBAC and when is it better to use RBAC?
I'm trying to understand the general concepts of the CBAC model but the general ...
157
votes
10
answers
42k
views
What is a good example to differentiate between fileprivate and private in Swift3
This article has been helpful in understanding the new access specifiers in Swift 3. It also gives some examples of different usages of fileprivate and private.
My question is - isn't using ...
90
votes
2
answers
24k
views
Access Control in Domain Driven Design
I read about DDD and Access Control, and I found some contradiction between the following two opinions:
"security concerns should be handled outside the domain"
"access control ...
79
votes
9
answers
554k
views
How to create a user in Oracle 11g and grant permissions
Can someone advise me on how to create a user in Oracle 11g and only grant that user the ability only to execute one particular stored procedure and the tables in that procedure.
I am not really sure ...
68
votes
7
answers
28k
views
Overriding public virtual functions with private functions in C++
Is there is any reason to make the permissions on an overridden C++ virtual function different from the base class? Is there any danger in doing so?
For example:
class base {
public:
...
57
votes
4
answers
13k
views
Is this key-oriented access-protection pattern a known idiom?
Matthieu M. brought up a pattern for access-protection in this answer that i'd seen before, but never conciously considered a pattern:
class SomeKey {
friend class Foo;
SomeKey() {}
// ...
55
votes
10
answers
62k
views
Best Role-Based Access Control (RBAC) database model [closed]
What is the best database schema to track role-based access controls for a web application?
I am using Rails, but the RBAC plugin linked by Google looks unmaintained (only 300 commits to SVN; latest ...
55
votes
3
answers
27k
views
public struct in framework init is inaccessible due to 'internal' protection level in compiler
I have a struct in a framework called "MyFramework"
public struct ShipmentPackage:Encodable {
let package_code:String
let weight:Float
}
Then when I try to create a ShipmentPackage in another ...
55
votes
3
answers
28k
views
How to make an instance property only visible to subclass?
I'm trying to declare an instance property in Swift so that it is only visible to its class and subclasses. I believe this would be referred to as a protected property in other languages. Is there a ...
52
votes
3
answers
62k
views
How to implement Permission Based Access Control with Asp.Net Core
I am trying to implement permission based access control with aspnet core. For dynamically managing user roles and permissions(create_product, delete_product etc.), they are stored in the database. ...
46
votes
7
answers
112k
views
Font Awesome icons not showing in Chrome, a MaxCDN related Cross-Origin Resource Sharing policy issue
just noticed on several websites that the font awesome icons aren's showing in Google Chrome. The console shows the following error:
Font from origin 'http://cdn.keywest.life' has been blocked ...
43
votes
6
answers
88k
views
How to Block an IP address range using the .htaccess file
I have detected that a range of IP addresses may be used in a malicious way and I don't know how to block it.
I would like to block the range 66.249.74.* from accessing my website by using the ....
41
votes
3
answers
141k
views
Error: Permission denied to access property "document"
I have a HTML Document which contains an iframe. Whenever I try to access or modify this iframe with JS I get Error: Permission denied to access property "document".
I am using frame.contentWindow....
40
votes
2
answers
119k
views
jQuery.getJSON - Access-Control-Allow-Origin Issue
I'm jusing jQuery's $.getJSON() function to return a short set of JSON data.
I've got the JSON data sitting on a url such as example.com.
I didn't realize it, but as I was accessing that same url, ...
39
votes
3
answers
68k
views
PHP: How can I block direct URL access to a file, but still allow it to be downloaded by logged in users?
I have a website where users should be able to log in and listen to a song (a self-created mp3). I want to make it so the logged in user can listen/download/whatever, and the file should reside on ...
38
votes
3
answers
25k
views
CORS Access-Control-Max-Age is ignored
I'm hosting an WebApp and his API on different domains and use CORS to be able to work around the same origin policy. So far, so good. This works.
To only send a CORS preflight once per session I set ...
38
votes
2
answers
223k
views
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
I'm using CometChat in my website and recently my users art having this problem with receiving messages. After inspection in FireBug i realized it must be because of the CORS protection (due to the ...
37
votes
6
answers
234k
views
How do I use Access-Control-Allow-Origin? Does it just go in between the html head tags?
I've been reading about Access-Control-Allow-Origin because it seems effective at allowing cross domain requests since I have access to the external site. My question ism how do I use Access-Control-...
36
votes
2
answers
29k
views
Symfony granting path access to multiple roles in security.yml
Hi I would like to be able to allow access to a path in security.yml based on the user either having ROLE_TEACHER, or ROLE_ADMIN.
According to the question in Multiple roles required for same url in ...
34
votes
4
answers
54k
views
How to add `nofollow, noindex` all pages in robots.txt?
I want to add nofollow and noindex to my site whilst it's being built. The client has request I use these rules.
I am aware of
<meta name="robots" content="noindex,nofollow">
...
33
votes
4
answers
86k
views
CORS not working php
I am trying to post form data from www.siteone.com to www.sitetwo.com via CORS. My ajax code is this:
<script>
$(document).ready(function(){
$("#submit").live('click',function() {
...
28
votes
5
answers
27k
views
How to set up a git repository where different users can only see certain parts?
How do you set up a git repository where some users can see certain parts of the source code and other users can see all of it? I've seen lots of guides for only giving certain users commit access, ...
28
votes
2
answers
25k
views
Do modern browsers encrypt or otherwise protect IndexedDB storage?
My team is considering using IndexedDB to cache data across user sessions. This data can be large enough that it would be a real performance boost to be able to keep it around in the browser for later ...
26
votes
11
answers
46k
views
Role Based Access Control
Is there any open-source, PHP based, role-based access control system that can be used for CodeIgniter?
26
votes
1
answer
28k
views
How to add an Access-Control-Allow-Origin header in IIS7 with restrictions
I need to access a font file in my application from the server that I also own. It works for all browsers but Firefox, and I know that I need to add a 'Access-Control-Allow-Origin' header.
So in the ...
25
votes
3
answers
9k
views
Granular access to directories within monorepo
I've been reading about the advantages of monorepos, but haven't yet found a mitigation for the problem of sharing parts of a repo:
Let's say an organization has a monorepo for a client/server web ...
23
votes
3
answers
31k
views
GitLab issuing temporary IP bans - 403 forbidden
My GitLab instance setup will occasionally put in place an IP ban on our own IP address, resulting in all our users in the office getting 403 / Forbidden on any web page or git request.
The ban is ...
22
votes
3
answers
11k
views
Adding Swift files to test target not fixing unit tests
I have looked at a lot of blogs and tried many things to get my Swift unit tests to work in Xcode 6.0.1 (or 6.1 for that matter). I'm trying to access classes in my app's target so I wrote this line:
...
22
votes
4
answers
6k
views
What is the best way to notify a user after an access_control rule redirects?
From Symfony 2.3 Security docs:
If access is denied, the system will try to authenticate the user if not already (e.g. redirect the user to the login page). If the user is already logged in, the ...
21
votes
4
answers
7k
views
Cannot access protected member of base class in derived class
I have the following code:
struct A {
protected:
A() {}
A* a;
};
struct B : A {
protected:
B() { b.a = &b; }
A b;
};
It strangely doesn't compile. The culprit is the b.a = &...
20
votes
1
answer
13k
views
Access Control for Swift Extensions
Swift Programming Language has this to say about access control for extension:
You can extend a class, structure, or enumeration in any access
context in which the class, structure, or ...
20
votes
6
answers
20k
views
Swift - How can I override an extension method in a concrete subclass
I have an extension on UIView implementing a protocol
protocol SomeProtocol {
var property : Int
}
extension UIView : SomeProtocol {
var property : Int {
get {
return 0
...
20
votes
5
answers
22k
views
Cross-Origin request warning for google fonts
I am using Google Webfonts on my website. In the console on Chrome I get the following warning:
Blink is considering rejecting non spec-compliant cross-origin web
font requests:
http://fonts....
19
votes
6
answers
56k
views
the protected and private member variables in C++ inheritance
I am a newbie to C++, I have a question regarding to the c++ protected and private members in inheritance.
If a class is public inherits a based class, does the protected and private member variable ...
18
votes
3
answers
29k
views
Accessing fileprivate and private variables in extension and another class using swift 4
I have been going through the recent swift docs and working out on few examples in understanding private and fileprivate keywords in swift4. I am trying to access a fileprivate and private variable in ...
18
votes
2
answers
33k
views
How to block access to Tomcat listening port, and allow localhost only?
I have an application running on Tomcat and listening on port 8080. I made the redirect changes on the Apache level (httpd) to provide my users with the ability to only type http://app instead of http:...
18
votes
4
answers
17k
views
Why does Mercurial return "Abort: Access is Denied" when trying to push a repository?
I'm running into a problem with a user not being able to push his commits into a Mercurial repository and am perplexed as to why it's not working for him. I've tried several things to figure out what'...
18
votes
5
answers
13k
views
How to display required user roles (access control information) in Swagger UI for Spring's endpoints?
I have a rest api made in Spring and am using Swagger for documentation. Recently a token based authentication was implemented. In the token, there are (internal) user's roles (authorities). Each ...
17
votes
3
answers
16k
views
Difference between fileprivate and private extension?
Swift 3.0
I know that fileprivate access level modifier limited using of function/property to source file where it was declared and private - limited to lexical scope where was declared. But it seems ...
17
votes
4
answers
18k
views
What is the simplest way to restrict access to a static website using social auth
I have a static website composed of HTML/CSS/JavaScript files. The website is automatically generated and updated frequently.
Instead of authorizing access to the website with a username/password (...
17
votes
4
answers
19k
views
Angular POST cross origin error while POSTMAN works
I try to POST from my angular login service:
$http.post('https://xyz/login',
{
headers: {
'Content-type': 'application/json',
'...
16
votes
3
answers
12k
views
Get controller and action name from AuthorizationHandlerContext object
Hi I have a custom requirement handler with accepts the AuthorizationHandlerContext context parameter
When i debug, i can see that the context object contains
Context.Resources.ActionDescription....
16
votes
2
answers
53k
views
What MongoDB user privileges do I need to add a user to a new/another mongo database?
I have enabled authentication in the MongoDB config file after adding one admin user with the following privileges: userAdmin and userAdminAnyDatabase.
Now I connect with this user to the db where ...
16
votes
4
answers
26k
views
Role Based Access Control in Angular2?
I understand the working of JWT based authentication, but I am struggling to understand the correct approach to create a role based access control in angular2.
Can some-one please provide a way to ...
16
votes
8
answers
11k
views
How to use the AccessDecisionManager in Symfony2 for authorization of arbitrary users?
I'd like to be able to verify whether or not attributes (roles) are granted to any arbitrary object implementing UserInterface in Symfony2. Is this possible?
UserInterface->getRoles() is not ...
16
votes
7
answers
15k
views
Browser application & local file system access
I want to enhance my browser-based web application with functionality that enables management of local files and folders. E.g. folder tree structures should be synchronized between local workstation ...
15
votes
2
answers
7k
views
Alternatives for Roles/Claims Access Control Systems
I am developing REST API for the growing system. And in general Role/Claims Access Control work perfecly like this.
[HttpGet]
[Route("settings")]
[Authorization(Type = AuthorizationType.Admin, ...
15
votes
1
answer
15k
views
Resource Based Access Control vs Role Based Access Control
I am learning Apache Shiro, and I found this article:
The New RBAC: Resource-Based Access Control
And the author said:
.......you could assign behaviors (permissions) directly to a Role if you
...
15
votes
4
answers
56k
views
How can I restrict access to certain URLs by source IP in Tomcat? [closed]
I want to restrict access to certain URLs in my Tomcat webapp.
Only 3 known IP addresses should be allowed access to URLs that fit a certain pattern.
e.g. http://example.com:1234/abc/personId
How ...