default field permissions I have created a module that adds a an extra field for each user. I do this by first creating the field using field_create_field and then I bind it to the user object using field_create_instance. This is standard practice I think.

Now, I would like to add so that by default only administrators should be able to change the value of this field. I would like to keep down the number of external modules, so if possible I would like this to be the default behavior after installing my module, without relying on other modules such as field_permissions to achieve this.

Is this possible?

Thanks in advance!
I found the answer. It is done using the hook_field_access. In my case, what I did was:

function my_module_field_access($op, $field, $type, $entity) {
    if ($op=="edit" &amp;&amp; $field["field_name"]=="my_field") {
        if (!user_access("administer users"))
            return FALSE;
    }
}