R
R
Rick2017-08-10 18:10:18
JavaScript
Rick, 2017-08-10 18:10:18

How to differentiate OpenLDAP rights?

Good afternoon! The task is to differentiate the rights in OpenLDAP.
For example, by OU-shkami or location. So that each user who is an admin can see groups from his location, for example.
And when integrating with different systems, the Owncloud example saw only groups that are in its OU or location.
If who faced, prompt where to dig. If there is a link to the manual, throw it here.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
webviewer, 2019-03-28
@webviewer

if (...) {
  //code
  return 0;
}
//code

This version is more readable.

R
Robur, 2019-03-28
@Robur

In this version, as you wrote, you don't need else at all. It's better not to write unnecessary code.
In other situations it may be different. else itself has no problems, write if needed.
The main rule with if is not to make the nesting too big and keep the code inside as short as possible, if it gets big enough - allocate it into a function.
PS. "0" in return is not needed.

D
Dmitry Derepko, 2019-03-28
@xEpozZ

If a

if (a>b){
a = 100;
}else{
a = 0;
}

better then
a = 0;
if(a > b){
a = 100;
}

if there is more logic in ifs, then as the guys above said
function setName(data){
let name;
if(data.firstName && data.lastName){
name = data.firstName + ' '  + data.lastName;
}else{
name = data.firstName + ' '  + data.lastName;
}
data.name = name;
}

if some void function, then you can
function start(){
if(something.isStarted){
return;
}
something.start();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question