Users Privilege

Users Privilege

modyking55modyking55 Posts: 14Questions: 7Answers: 0

if i had a lot of users and i want to make one of them don't have access to some columns like
Field::inst( 'name' )
->get(false)
should i make a separate html and java files

and if i want to make him just edit what should i do i know i can put in set just true or false there is any other values ?
Field::inst( 'name' )
->set( $_SESSION['access']['editing'] )

Answers

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    should i make a separate html and java files

    That is one option. Another would be to generate the HTML / Javascript dynamically based on the permissions (which is the approach I normally take myself), or if you don't mind the other columns being referenced in the code (just not accessible), then you could use an if statement based on the user access rights.

    and if i want to make him just edit what should i do i know i can put in set just true or false there is any other values ?

    Yes, you can allow just setting:

    Field::inst( 'name' )
      ->set( Field::SET_EDIT )
    

    Another option would be to toggle the field's set parameter using an event.

    Allan

This discussion has been closed.