Hi everybody,
For my project I wanted per field permissions for user fields. The module field_permissions didn't work so well, therefor I decided to build a simple version myself. I haven't created the functions that make a nice backend yet (so all the setting are written down in the database manually for now) and there's a lot of duplicated code but can someone comment my module so far?
user_field_permissions.info
name = User field permissions
description = "Sets permissions to certain user fields making them only viewable/editable by certain roles"
package = User field permissions
core = 7.x
files[] = user_field_permissions.install
files[] = user_field_permissions.module
user_field_permissions.install
<?php
/**
* @file
* Install and uninstall schema for the user_field_permissions module.
*/
/**
* Implementation of hook_schema().
*/
function user_field_permissions_schema() {
$schema['user_field_permissions'] = array(
'description' => 'Stores user field permissions',
'fields' => array(
'id' => array(
'description' => 'The unique identifier for this item.',
'type' => 'serial',
'not null' => TRUE,
'disp-width' => '11',
'unsigned' => TRUE,
),
'rid' => array(
'description' => 'The role id as seen in the table role',
'type' => 'int',