Questions tagged [policy]

Best practice and style are at the core of every program; there is always a better way to do something. Policy helps programmers determine how something should be written.

Policy is a more or less ambiguous way of describing the best way to do something in programming. This can often be described as "best practice" when writing a program. This can pertain to the way a method returns a value, the way inheritance is structured, and the way to exit a loop, among other things, and it can vary from language to language.

Many companies often have their own sets of internal documentation referred to as Coding Standards that enforce policies which they determine to be valuable for maintenance and readability purposes of their code base.

You can learn more about policy and programming paradigm here.

1311 questions
23
votes
5 answers

Why is there no synchronous WebSocket support in Web Workers when there is synchronous FileSystem support?

I understand why browser vendors don't want to help me block their UI thread. However, I don't understand why there is: no sleep(2) in Web Workers no synchronous WebSockets API There is a synchronous FileSystem API. There is also a synchronous…
Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
22
votes
1 answer

Limiting file access in Java

Problem: In my Java application (not an applet) I wish to limit certain file operations to all classes except a list/group/package of classes that should not be restricted. Specifically, I would like to limit... File reads File writes File…
obfuscation
  • 1,023
  • 3
  • 16
  • 23
22
votes
4 answers

s3 Policy has invalid action - s3:ListAllMyBuckets

I'm trying these policy through console.aws.amazon.com on my buckets: { "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation", …
zdev
  • 425
  • 1
  • 4
  • 9
21
votes
8 answers

How can I make a S3 bucket public (the amazon example policy doesn't work)?

Amazon provides an example for Granting Permission to an Anonymous User as follows (see Example Cases for Amazon S3 Bucket Policies): { "Version": "2008-10-17", "Statement": [ { "Sid": "AddPerm", "Effect":…
GoodGets
  • 1,829
  • 3
  • 18
  • 21
19
votes
1 answer

Pyramid authorization for stored items

I'm trying to create an authorization policy that takes "item" ownership into account. For example some user X "owns" items A, B, C. Those are accessed via URLs like /item/{item}/some_options. How can I get the information about {item} to the…
viraptor
  • 33,322
  • 10
  • 107
  • 191
19
votes
4 answers

Access Denied upload to s3

I tried uploading to s3 and when I see the logs from the s3 bucket logs this is what it says: mybucket-me [17/Oct/2013:08:18:57 +0000] 120.28.112.39 arn:aws:sts::778671367984:federated-user/dean@player.com BB3AA9C408C0D26F REST.POST.BUCKET…
Wondering Coder
  • 1,652
  • 9
  • 31
  • 51
17
votes
3 answers

Android - EU Cookie Law

The upcoming Google policy changes, compel us to implement a dialog to notify EU users about cookie/device identifier usage for advertising and analytics. I'd like to show this dialog only to EU users. I don't want to use additional permissions…
Mr.Betatester
  • 495
  • 3
  • 17
17
votes
5 answers

Sails.js Policies, is there an OR operator to allow an action if one of a group of policies succeeds?

When configuring policies in sails in config/policies.js such as: ActivityController: { create: ['authenticated'], update: ['authenticated', 'isActivityOwner'], destroy: ['authenticated' ,'isActivityOwner'] } Is…
16
votes
1 answer

amazon S3 bucket policy - restricting access by referer BUT not restricting if urls are generated via query string authentication

I have the following bucket policy set on my bucket: { "Version": "2008-10-17", "Id": "My access policy", "Statement": [ { "Sid": "Allow only requests from our site", "Effect": "Allow", "Principal": { "AWS": "*" …
Simon Polak
  • 1,959
  • 1
  • 13
  • 21
16
votes
5 answers

NuGet Package Manager Console (PMC) policy settings

In VS2013, when I try to open the NuGet Package Manager Console, I suddenly get the error: Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due…
smolesen
  • 1,153
  • 3
  • 11
  • 29
15
votes
1 answer

Separate policy from mechanism: What does it mean?

I've often heard the mantra of "separating policy from mechanism", especially in the context of the Unix philosopy. What does this mean and what are some concrete examples of it? When/why is/isn't it a good thing?
dsimcha
  • 67,514
  • 53
  • 213
  • 334
15
votes
5 answers

Java RMI Tutorial - AccessControlException: access denied (java.io.FilePermission

Yesterday I tried to get started with Java RMI. I found this sun tutorial (http://java.sun.com/docs/books/tutorial/rmi/index.html) and started with the server implemantation. But everytime I start the pogram (the rmiregistry is running) I get an…
user25913
  • 221
  • 1
  • 2
  • 5
15
votes
4 answers

Restrict List of Buckets for a Specific User

I've been able to generate a user policy that only gives access to a specific bucket, however after trying everything (including this post: Is there an S3 policy for limiting access to only see/access one bucket?). The problem: I am unable to…
random_user_name
  • 25,694
  • 7
  • 76
  • 115
14
votes
2 answers

S3 bucket policy, how to ALLOW a IAM group from another account?

I have one S3 bucket in one AWS account (say arn:aws:s3:::my-test-bucket), that needs to be accessed by a IAM group that is defined in another AWS account (say arn:aws:iam::1111222333444:group/mygroup). The following access policy refuses to save,…
Danduk82
  • 769
  • 1
  • 10
  • 29
12
votes
2 answers

How to create AWS IAM role attaching managed policy only using Boto3

I am trying to use Boto3 to create a new instance role that will attach a managed policy only. I have the following: Policy Name: my_instance_policy Policy ARN: arn:aws:iam::123456789012:policy/my_test_policy I want to create the role called…
Rafiq
  • 1,380
  • 4
  • 16
  • 31
1
2
3
87 88