Commit a8340964 authored by Frank Bergmann's avatar Frank Bergmann

- fixed an issues updating the password of the user itself

- showing overdue forum items in red
parent d9762c9e
...@@ -303,38 +303,40 @@ select acs_privilege__create_privilege('add_topic_pm','Message to the project ma ...@@ -303,38 +303,40 @@ select acs_privilege__create_privilege('add_topic_pm','Message to the project ma
select acs_privilege__add_child('admin', 'add_topic_pm'); select acs_privilege__add_child('admin', 'add_topic_pm');
select acs_privilege__create_privilege('view_topics_all','View all topics','');
select acs_privilege__add_child('admin', 'view_topics_all');
------------------------------------------------------
-- See All Topics
---
select im_priv_create('view_topics_all', 'Employees');
select im_priv_create('view_topics_all', 'P/O Admins');
select im_priv_create('view_topics_all', 'Project Managers');
select im_priv_create('view_topics_all', 'Senior Managers');
------------------------------------------------------ ------------------------------------------------------
-- Add Topic PM -- Add Topic PM
--- ---
select im_priv_create('add_topic_pm', 'Accounting'); select im_priv_create('add_topic_pm', 'Accounting');
select im_priv_create('add_topic_pm', 'Customers'); select im_priv_create('add_topic_pm', 'Customers');
select im_priv_create('add_topic_pm', 'Employees'); select im_priv_create('add_topic_pm', 'Employees');
select im_priv_create('add_topic_pm', 'Freelancers'); select im_priv_create('add_topic_pm', 'Freelancers');
select im_priv_create('add_topic_pm', 'P/O Admins'); select im_priv_create('add_topic_pm', 'P/O Admins');
select im_priv_create('add_topic_pm', 'Project Managers'); select im_priv_create('add_topic_pm', 'Project Managers');
select im_priv_create('add_topic_pm', 'Sales'); select im_priv_create('add_topic_pm', 'Sales');
select im_priv_create('add_topic_pm', 'Senior Managers'); select im_priv_create('add_topic_pm', 'Senior Managers');
------------------------------------------------------ ------------------------------------------------------
-- Add Topic Client -- Add Topic Client
--- ---
select im_priv_create('add_topic_client', 'Accounting'); select im_priv_create('add_topic_client', 'Accounting');
select im_priv_create('add_topic_client', 'P/O Admins'); select im_priv_create('add_topic_client', 'P/O Admins');
select im_priv_create('add_topic_client', 'Sales'); select im_priv_create('add_topic_client', 'Sales');
select im_priv_create('add_topic_client', 'Senior Managers'); select im_priv_create('add_topic_client', 'Senior Managers');
...@@ -343,40 +345,28 @@ select im_priv_create('add_topic_client', 'Senior Managers'); ...@@ -343,40 +345,28 @@ select im_priv_create('add_topic_client', 'Senior Managers');
-- Add Topic Public -- Add Topic Public
--- ---
select im_priv_create('add_topic_public', 'P/O Admins'); select im_priv_create('add_topic_public', 'P/O Admins');
select im_priv_create('add_topic_public', 'Senior Managers'); select im_priv_create('add_topic_public', 'Senior Managers');
------------------------------------------------------ ------------------------------------------------------
-- Add Topic Non-Clients -- Add Topic Non-Clients
--- ---
select im_priv_create('add_topic_noncli', 'Accounting'); select im_priv_create('add_topic_noncli', 'Accounting');
select im_priv_create('add_topic_noncli', 'Employees'); select im_priv_create('add_topic_noncli', 'Employees');
select im_priv_create('add_topic_noncli', 'Freelancers'); select im_priv_create('add_topic_noncli', 'Freelancers');
select im_priv_create('add_topic_noncli', 'P/O Admins'); select im_priv_create('add_topic_noncli', 'P/O Admins');
select im_priv_create('add_topic_noncli', 'Project Managers'); select im_priv_create('add_topic_noncli', 'Project Managers');
select im_priv_create('add_topic_noncli', 'Sales'); select im_priv_create('add_topic_noncli', 'Sales');
select im_priv_create('add_topic_noncli', 'Senior Managers'); select im_priv_create('add_topic_noncli', 'Senior Managers');
------------------------------------------------------ ------------------------------------------------------
-- Add Topic Groups -- Add Topic Groups
--- ---
select im_priv_create('add_topic_group', 'Accounting'); select im_priv_create('add_topic_group', 'Accounting');
select im_priv_create('add_topic_group', 'P/O Admins'); select im_priv_create('add_topic_group', 'P/O Admins');
select im_priv_create('add_topic_group', 'Sales'); select im_priv_create('add_topic_group', 'Sales');
select im_priv_create('add_topic_group', 'Senior Managers'); select im_priv_create('add_topic_group', 'Senior Managers');
...@@ -386,33 +376,21 @@ select im_priv_create('add_topic_group', 'Senior Managers'); ...@@ -386,33 +376,21 @@ select im_priv_create('add_topic_group', 'Senior Managers');
-- Add Topic Public -- Add Topic Public
--- ---
select im_priv_create('add_topic_client', 'P/O Admins'); select im_priv_create('add_topic_client', 'P/O Admins');
select im_priv_create('add_topic_client', 'Senior Managers'); select im_priv_create('add_topic_client', 'Senior Managers');
------------------------------------------------------ ------------------------------------------------------
-- Add Topic Staff -- Add Topic Staff
--- ---
select im_priv_create('add_topic_staff', 'Accounting'); select im_priv_create('add_topic_staff', 'Accounting');
select im_priv_create('add_topic_staff', 'Employees'); select im_priv_create('add_topic_staff', 'Employees');
select im_priv_create('add_topic_staff', 'Freelancers'); select im_priv_create('add_topic_staff', 'Freelancers');
select im_priv_create('add_topic_staff', 'P/O Admins'); select im_priv_create('add_topic_staff', 'P/O Admins');
select im_priv_create('add_topic_staff', 'Project Managers'); select im_priv_create('add_topic_staff', 'Project Managers');
select im_priv_create('add_topic_staff', 'Sales'); select im_priv_create('add_topic_staff', 'Sales');
select im_priv_create('add_topic_staff', 'Senior Managers'); select im_priv_create('add_topic_staff', 'Senior Managers');
--------------------------------------------------------- ---------------------------------------------------------
-- Register the component in the core TCL pages -- Register the component in the core TCL pages
-- --
......
...@@ -73,17 +73,7 @@ where ...@@ -73,17 +73,7 @@ where
(t.parent_id is null or t.parent_id=0) (t.parent_id is null or t.parent_id=0)
and t.object_id != 1 and t.object_id != 1
and t.object_id = o.object_id and t.object_id = o.object_id
and 1 = im_forum_permission( $permission_clause
:user_id,
t.owner_id,
t.asignee_id,
t.object_id,
t.scope,
member_objects.p,
admin_objects.p,
:user_is_employee_p,
:user_is_customer_p
)
$restriction_clause $restriction_clause
$order_by_clause $order_by_clause
......
...@@ -976,7 +976,27 @@ ad_proc -public im_forum_component { ...@@ -976,7 +976,27 @@ ad_proc -public im_forum_component {
set restriction_clause "and $restriction_clause" set restriction_clause "and $restriction_clause"
} }
ns_log Notice "im_forum_component: restriction_clause=$restriction_clause" ns_log Notice "im_forum_component: restriction_clause=$restriction_clause"
# Permissions - who should see what
set permission_clause "
and 1 = im_forum_permission(
:user_id,
t.owner_id,
t.asignee_id,
t.object_id,
t.scope,
member_objects.p,
admin_objects.p,
:user_is_employee_p,
:user_is_customer_p
)"
# We only want to remove the permission clause if the
# user is allowed to see all items
if {[im_permission $user_id view_topics_all]} {
set permission_clause ""
}
# Get the forum_sql statement # Get the forum_sql statement
# Forum items have a complicated "scoped" permission # Forum items have a complicated "scoped" permission
......
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