Answer the question
In order to leave comments, you need to log in
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
if (...) {
//code
return 0;
}
//code
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.
If a
if (a>b){
a = 100;
}else{
a = 0;
}
a = 0;
if(a > b){
a = 100;
}
function setName(data){
let name;
if(data.firstName && data.lastName){
name = data.firstName + ' ' + data.lastName;
}else{
name = data.firstName + ' ' + data.lastName;
}
data.name = name;
}
function start(){
if(something.isStarted){
return;
}
something.start();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question