Add AuthenticationServiceProvider

This commit is contained in:
Romain Neutron
2013-02-15 11:12:22 +01:00
parent d2bc4f4a23
commit 6537b96f4c
30 changed files with 158 additions and 173 deletions

View File

@@ -107,17 +107,17 @@ class record_exportElement extends record_adapter
'thumbnail' => true
);
if ($this->app['phraseanet.user']->ACL()->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
if ($this->app['authentication']->getUser()->ACL()->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
$go_dl['document'] = true;
}
if ($this->app['phraseanet.user']->ACL()->has_right_on_base($this->get_base_id(), 'candwnldpreview')) {
if ($this->app['authentication']->getUser()->ACL()->has_right_on_base($this->get_base_id(), 'candwnldpreview')) {
$go_dl['preview'] = true;
}
if ($this->app['phraseanet.user']->ACL()->has_hd_grant($this)) {
if ($this->app['authentication']->getUser()->ACL()->has_hd_grant($this)) {
$go_dl['document'] = true;
$go_dl['preview'] = true;
}
if ($this->app['phraseanet.user']->ACL()->has_preview_grant($this)) {
if ($this->app['authentication']->getUser()->ACL()->has_preview_grant($this)) {
$go_dl['preview'] = true;
}
@@ -127,14 +127,14 @@ class record_exportElement extends record_adapter
->who_have_right(array('order_master'))
->execute()->get_results();
$go_cmd = (count($masters) > 0 && $this->app['phraseanet.user']->ACL()->has_right_on_base($this->base_id, 'cancmd'));
$go_cmd = (count($masters) > 0 && $this->app['authentication']->getUser()->ACL()->has_right_on_base($this->base_id, 'cancmd'));
$orderable['document'] = false;
$downloadable['document'] = false;
if (isset($sd['document']) && is_file($sd['document']->get_pathfile())) {
if ($go_dl['document'] === true) {
if ($this->app['phraseanet.user']->ACL()->is_restricted_download($this->base_id)) {
if ($this->app['authentication']->getUser()->ACL()->is_restricted_download($this->base_id)) {
$this->remain_hd --;
if ($this->remain_hd >= 0)
$downloadable['document'] = array(
@@ -182,7 +182,7 @@ class record_exportElement extends record_adapter
if (isset($sd[$name]) && is_file($sd[$name]->get_pathfile())) {
if ($class == 'document') {
if ($this->app['phraseanet.user']->ACL()->is_restricted_download($this->base_id)) {
if ($this->app['authentication']->getUser()->ACL()->is_restricted_download($this->base_id)) {
$this->remain_hd --;
if ($this->remain_hd >= 0)
$downloadable[$name] = array(