Commit 818eb862 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Nouveau champ pour savoir s'il faut rendre le rôle accessible ou non de l'extérieur

parent 2580fd63
Pipeline #5909 failed with stage
in 14 seconds
...@@ -18,6 +18,7 @@ CREATE TABLE IF NOT EXISTS user_role ( ...@@ -18,6 +18,7 @@ CREATE TABLE IF NOT EXISTS user_role (
is_default TINYINT(1) NOT NULL DEFAULT 0, is_default TINYINT(1) NOT NULL DEFAULT 0,
parent_id INTEGER NULL DEFAULT NULL, parent_id INTEGER NULL DEFAULT NULL,
ldap_filter varchar(255) DEFAULT NULL, ldap_filter varchar(255) DEFAULT NULL,
accessible_exterieur TINYINT(1) NOT NULL DEFAULT 1,
FOREIGN KEY (parent_id) REFERENCES user_role (id) ON DELETE SET NULL FOREIGN KEY (parent_id) REFERENCES user_role (id) ON DELETE SET NULL
); );
......
...@@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS user_role ( ...@@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS user_role (
is_default TINYINT(1) NOT NULL DEFAULT 0, is_default TINYINT(1) NOT NULL DEFAULT 0,
parent_id INT(11) NULL DEFAULT NULL, parent_id INT(11) NULL DEFAULT NULL,
ldap_filter varchar(255) CHARACTER SET utf8 DEFAULT NULL, ldap_filter varchar(255) CHARACTER SET utf8 DEFAULT NULL,
accessible_exterieur TINYINT(1) NOT NULL DEFAULT 1,
PRIMARY KEY (id), PRIMARY KEY (id),
UNIQUE INDEX unique_role (role_id ASC), UNIQUE INDEX unique_role (role_id ASC),
INDEX idx_parent_id (parent_id ASC), INDEX idx_parent_id (parent_id ASC),
......
...@@ -18,9 +18,10 @@ create unique index USER_PASSWORD_RESET_TOKEN_UN on "USER" (PASSWORD_RESET_TOKEN ...@@ -18,9 +18,10 @@ create unique index USER_PASSWORD_RESET_TOKEN_UN on "USER" (PASSWORD_RESET_TOKEN
CREATE TABLE USER_ROLE CREATE TABLE USER_ROLE
( "ID" NUMBER(*,0) NOT NULL ENABLE, ( "ID" NUMBER(*,0) NOT NULL ENABLE,
"ROLE_ID" VARCHAR2(64 CHAR) NOT NULL ENABLE, "ROLE_ID" VARCHAR2(64 CHAR) NOT NULL ENABLE,
"IS_DEFAULT" NUMBER(38,0) NOT NULL ENABLE, "IS_DEFAULT" NUMBER(1) NOT NULL ENABLE,
"PARENT_ID" NUMBER(*,0), "PARENT_ID" NUMBER(*,0),
"LDAP_FILTER" VARCHAR2(255) DEFAULT NULL, "LDAP_FILTER" VARCHAR2(255) DEFAULT NULL,
"ACCESSIBLE_EXTERIEUR" NUMBER(1) DEFAULT 1 NOT NULL ENABLE,
CONSTRAINT "USER_ROLE_PK" PRIMARY KEY ("ID"), CONSTRAINT "USER_ROLE_PK" PRIMARY KEY ("ID"),
CONSTRAINT "USER_ROLE_ROLE_UN" UNIQUE ("ROLE_ID"), CONSTRAINT "USER_ROLE_ROLE_UN" UNIQUE ("ROLE_ID"),
CONSTRAINT "USER_ROLE_USER_ROLE_FK" FOREIGN KEY ("PARENT_ID") REFERENCES USER_ROLE ("ID") ENABLE CONSTRAINT "USER_ROLE_USER_ROLE_FK" FOREIGN KEY ("PARENT_ID") REFERENCES USER_ROLE ("ID") ENABLE
......
...@@ -18,6 +18,7 @@ CREATE TABLE user_role ( ...@@ -18,6 +18,7 @@ CREATE TABLE user_role (
is_default SMALLINT NOT NULL DEFAULT 0, is_default SMALLINT NOT NULL DEFAULT 0,
parent_id BIGINT DEFAULT NULL, parent_id BIGINT DEFAULT NULL,
ldap_filter varchar(255) DEFAULT NULL, ldap_filter varchar(255) DEFAULT NULL,
accessible_exterieur SMALLINT NOT NULL DEFAULT 1,
FOREIGN KEY (parent_id) REFERENCES user_role (id) ON DELETE SET NULL FOREIGN KEY (parent_id) REFERENCES user_role (id) ON DELETE SET NULL
); );
CREATE UNIQUE INDEX user_role_roleid_unique ON user_role (role_id); CREATE UNIQUE INDEX user_role_roleid_unique ON user_role (role_id);
......
...@@ -44,6 +44,12 @@ abstract class AbstractRole implements RoleInterface ...@@ -44,6 +44,12 @@ abstract class AbstractRole implements RoleInterface
*/ */
protected $ldapFilter; protected $ldapFilter;
/**
* @var boolean
* @ORM\Column(name="accessible_exterieur", type="boolean", nullable=false)
*/
protected $accessibleExterieur = true;
/** /**
* @var \Doctrine\Common\Collections\Collection * @var \Doctrine\Common\Collections\Collection
* @ORM\ManyToMany(targetEntity="UnicaenAuth\Entity\Db\User") * @ORM\ManyToMany(targetEntity="UnicaenAuth\Entity\Db\User")
...@@ -178,6 +184,32 @@ abstract class AbstractRole implements RoleInterface ...@@ -178,6 +184,32 @@ abstract class AbstractRole implements RoleInterface
return $this; return $this;
} }
/**
* @return bool
*/
public function getAccessibleExterieur(): bool
{
return $this->accessibleExterieur;
}
/**
* @param bool $accessibleExterieur
*
* @return self
*/
public function setAccessibleExterieur($accessibleExterieur): self
{
$this->accessibleExterieur = (bool)$accessibleExterieur;
return $this;
}
/** /**
* Get users. * Get users.
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment