ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\Container\Setup\WebFeedCreationDeletedObjective Class Reference
+ Inheritance diagram for ILIAS\Container\Setup\WebFeedCreationDeletedObjective:
+ Collaboration diagram for ILIAS\Container\Setup\WebFeedCreationDeletedObjective:

Public Member Functions

 __construct (string $type, string $ops_name)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 
- Public Member Functions inherited from ilAccessRBACOperationDeletedObjective
 __construct (string $type, int $ops_id)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 
 isApplicable (Environment $environment)
 

Protected Attributes

string $type
 
string $ops_name
 
- Protected Attributes inherited from ilAccessRBACOperationDeletedObjective
string $type
 
int $ops_id
 

Detailed Description

Definition at line 25 of file WebFeedCreationDeletedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Container\Setup\WebFeedCreationDeletedObjective::__construct ( string  $type,
string  $ops_name 
)

Member Function Documentation

◆ achieve()

ILIAS\Container\Setup\WebFeedCreationDeletedObjective::achieve ( Environment  $environment)

Reimplemented from ilAccessRBACOperationDeletedObjective.

Definition at line 58 of file WebFeedCreationDeletedObjective.php.

58 : Environment
59 {
60 $db = $environment->getResource(Environment::RESOURCE_DATABASE);
61
62 $set = $db->queryF(
63 "SELECT * FROM rbac_operations " .
64 " WHERE operation = %s ",
65 ["text"],
66 [$this->ops_name]
67 );
68 while ($rec = $db->fetchAssoc($set)) {
69 $this->ops_id = (int) $rec["ops_id"];
70 if ($this->ops_id > 0) {
71
72 $set2 = $db->query(
73 "SELECT obj_id FROM object_data"
74 . " WHERE type = 'typ'"
75 . " AND title = " . $db->quote($this->type, 'text')
76 )
77 ;
78 if ($rec2 = $db->fetchAssoc($set2)) {
79 $type_id = (int) $rec2["obj_id"];
80 if ($type_id > 0) {
81
82 $sql =
83 "DELETE FROM rbac_ta" . PHP_EOL
84 . "WHERE typ_id = " . $db->quote($type_id, "integer") . PHP_EOL
85 . "AND ops_id = " . $db->quote($this->ops_id, "integer") . PHP_EOL
86 ;
87
88 $db->manipulate($sql);
89
90 $sql =
91 "DELETE FROM rbac_templates" . PHP_EOL
92 . " WHERE type = " . $db->quote($this->type, "text") . PHP_EOL
93 . " AND ops_id = " . $db->quote($this->ops_id, "integer") . PHP_EOL
94 ;
95
96 $db->manipulate($sql);
97 }
98 }
99 }
100 }
101 return $environment;
102 }

References ILIAS\$db, ILIAS\Setup\Environment\getResource(), ILIAS\Repository\int(), and ILIAS\Setup\Environment\RESOURCE_DATABASE.

+ Here is the call graph for this function:

◆ getHash()

ILIAS\Container\Setup\WebFeedCreationDeletedObjective::getHash ( )

Reimplemented from ilAccessRBACOperationDeletedObjective.

Definition at line 36 of file WebFeedCreationDeletedObjective.php.

36 : string
37 {
38 return hash("sha256", self::class . $this->type . $this->ops_name);
39 }

◆ getLabel()

ILIAS\Container\Setup\WebFeedCreationDeletedObjective::getLabel ( )

Reimplemented from ilAccessRBACOperationDeletedObjective.

Definition at line 41 of file WebFeedCreationDeletedObjective.php.

41 : string
42 {
43 return "Delete webfeed creation permissions $this->type and name $this->ops_name";
44 }

◆ getPreconditions()

ILIAS\Container\Setup\WebFeedCreationDeletedObjective::getPreconditions ( Environment  $environment)

Reimplemented from ilAccessRBACOperationDeletedObjective.

Definition at line 51 of file WebFeedCreationDeletedObjective.php.

51 : array
52 {
53 return [
54 new \ilDatabaseInitializedObjective()
55 ];
56 }

◆ isNotable()

ILIAS\Container\Setup\WebFeedCreationDeletedObjective::isNotable ( )

Reimplemented from ilAccessRBACOperationDeletedObjective.

Definition at line 46 of file WebFeedCreationDeletedObjective.php.

46 : bool
47 {
48 return true;
49 }

Field Documentation

◆ $ops_name

string ILIAS\Container\Setup\WebFeedCreationDeletedObjective::$ops_name
protected

◆ $type

string ILIAS\Container\Setup\WebFeedCreationDeletedObjective::$type
protected

The documentation for this class was generated from the following file: