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
182
votes
32 answers

Is there a valid reason for enforcing a maximum width of 80 characters in a code file, this day and age?

Seriously. On a 22" monitor, it only covers maybe a quarter of the screen. I need some ammo to axe down this rule. I'm not saying that there shouldn't be a limit; I'm just saying, 80 characters is very small.
TraumaPony
  • 10,742
  • 12
  • 54
  • 74
173
votes
12 answers

The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

When I input any code in this function (e.g. console.log();) and click "Save", an error occurs: The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2 exports.handler = (event, context, callback) => { …
fish
  • 2,173
  • 2
  • 13
  • 18
144
votes
23 answers

Is there an S3 policy for limiting access to only see/access one bucket?

I have a simple bucket that looks like images.mysite.com on my S3 and other buckets containing backups, etc. I want to allow a specific user to be able to access the images.mysite.com bucket in order to upload images. However, I DO NOT want him to…
Alex
  • 4,367
  • 5
  • 29
  • 45
120
votes
2 answers

How long should I wait after applying an AWS IAM policy before it is valid?

I'm adding and removing AWS IAM user policies programmatically, and I'm getting inconsistent results from the application of those policies. For example, this may or may not succeed (I'm using the Java 1.6.6 SDK): Start with a user that can read…
84
votes
10 answers

How to disable Google asking permission to regularly check installed apps on my phone?

I'm developing an Android app, which I therefore endlessly build and install on my test device. Since a couple days I get with every build/install a question asking Google may regularly check installed apps for potentially harmfull behaviour.…
kramer65
  • 50,427
  • 120
  • 308
  • 488
79
votes
1 answer

What parameters are allowed in Desktop web game policy change?

We have a browser based game which uses Facebook Connect through an AppID that we used to run the same game in a canvas until Fb Credits were introduced and we were forced to shut it down. Now, we only use the App the same way as a product page with…
Christopher Lörken
  • 2,740
  • 18
  • 17
59
votes
1 answer

URL for public Amazon S3 bucket

I have an Amazon S3 bucket that I make public with a policy like this { "Version": "2012-10-17", "Statement": [ { "Sid": "Allow Public Access to All Objects", "Effect": "Allow", "Principal": "*", …
Gene Vincent
  • 5,237
  • 9
  • 50
  • 86
48
votes
5 answers

iOS recurring subscription policy for service, not content

Apologies in advance for a policy, rather than a programming question, but given the paucity of information available online I hope I can be forgiven for asking it here. I would like to use the new recurring subscriptions from Apple in an iOS app. I…
Roger
  • 15,793
  • 4
  • 51
  • 73
41
votes
1 answer

Difference between specification and a policy?

I am reading the brilliant book "Domain Driven Design" written by Eric Evans. In his book Eric describes two different concepts: the specification pattern and policies. Here is an example for a specification: public interface ProjectSpecification…
MUG4N
  • 19,377
  • 11
  • 56
  • 83
38
votes
3 answers

Laravel: Difference Between Route Middleware and Policy

Developing an app with laravel I realised that what can be done with Policy can exactly be done with Middleware. Say I want to prevent a user from updating a route if he/she is not the owner of the information, I can easily check from the route and…
George
  • 3,757
  • 9
  • 51
  • 86
36
votes
8 answers

Warning of Google Play Developer policy violation: Action Required

I recently received many mails from google for many of my apps. The email content is: Hello Google Play Developer, Our records show that your app, XXXX, with package name com.XXXX.XXXXXXXXXX, currently violates our User Data policy regarding …
ysnsyhn
  • 457
  • 1
  • 6
  • 12
35
votes
2 answers

Amazon S3 files access policy based on IP Address

Is there any way to limit the access of a file stored in Amazon S3 based on the client IP address? I have a file stored there, which should be access only by specific IP address. How to do this?
Daniel Cukier
  • 11,502
  • 15
  • 68
  • 123
29
votes
6 answers

Access denied when put bucket policy on aws s3 bucket with root user (= bucket owner)

I have an AWS root user which I used to create a S3 bucket on Amazon. Now I want to make this bucket public by adding following policy: { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": "*", "Action":…
Tijl .Reynhout
  • 901
  • 2
  • 9
  • 24
28
votes
3 answers

Restricting S3 bucket access to a VPC

I am trying to apply the following policy in order to restrict my_bucket's access to a particular VPC. When I try to apply this as a bucket policy, I get an Policy has an invalid condition key - ec2:Vpc. How do I correct this? { "Version":…
Lelouch Lamperouge
  • 8,171
  • 8
  • 49
  • 60
24
votes
8 answers

App is not compliant with how REQUEST_INSTALL_PACKAGES permission is allowed

I got this email from google play after updating my app build with flutter : After a recent review, we found that your app is not compliant with one or more of our Developer Program Policies. See below for more information about your app's status…
MANISH
  • 2,883
  • 4
  • 11
  • 30
1
2 3
87 88