Catalyst-Plugin-Authorization-Abilities

 view release on metacpan or  search on metacpan

t/lib/MyApp/Controller/Admin/Action.pm  view on Meta::CPAN

}

=head2 add_action

add a action

=cut
sub add_action : Chained('base_action') :PathPart('add') Args(0) {
  my ( $self, $c ) = @_;

  $c->stash->{legend} = "Add_a_action";
  $c->forward('edit_action');
}

=head2 del_action

delete a action

=cut
sub del_action : Chained('action') :PathPart('del') Args(0){
    my ( $self, $c ) = @_;

t/lib/MyApp/Controller/Admin/Action.pm  view on Meta::CPAN

=head2 edit

edit a action

=cut
sub edit_action : Chained('action') :PathPart('edit') Args(0){
  my ( $self, $c ) = @_;


  if (defined $c->stash->{action} ){
    $c->stash->{legend} = "Edit_a_action";
  }



  # form FormFu ------------------------------------
  my $form = HTML::FormFu->new;

  my $fs = $form->element('Fieldset')->legend($c->stash->{legend})->attrs({ class => 'alt'});

  $fs->element(
	       {type    => 'Text',
		name    => 'name',
		label   => 'Name',
		constraint => ['Required'],
	       });

  $fs->element(
	       {type    => 'Submit',

t/lib/MyApp/Controller/Admin/Role.pm  view on Meta::CPAN

}

=head2 add_role

add a role

=cut
sub add_role : Chained('base_role') :PathPart('add') Args(0) {
  my ( $self, $c ) = @_;

  $c->stash->{legend} = "Add_a_role";
  $c->forward('edit_role');
}

=head2 del_role

delete a role

=cut
sub del_role : Chained('role') :PathPart('del') Args(0){
    my ( $self, $c ) = @_;

t/lib/MyApp/Controller/Admin/Role.pm  view on Meta::CPAN


edit a role

=cut
sub edit_role : Chained('role') :PathPart('edit') Args(0){

  my ( $self, $c ) = @_;

  if ($c->stash->{role_id} ){

    $c->stash->{legend} = "Edit_a_role";

    my $role_roles_id;
    foreach my $role ( $c->stash->{role}->roles ){
      $role_roles_id->{$role->id} = 1;
    }
    $c->stash->{role_roles_id} = $role_roles_id;

    my $role_actions_id;
    foreach my $action ( $c->stash->{role}->actions ){
      $role_actions_id->{$action->id} = 1;

t/lib/MyApp/Controller/Admin/Role.pm  view on Meta::CPAN

    $c->stash->{role_actions_id} = $role_actions_id;

  }

  $c->stash->{allroles}   = $c->model('DBIC::Role');
  $c->stash->{allactions} = $c->model('DBIC::Action');

  # form FormFu ------------------------------------
  my $form = HTML::FormFu->new;

  my $fs = $form->element('Fieldset')->legend($c->stash->{legend})->attrs({ class => 'alt'});


  $fs->element(
	       {type    => 'Text',
		name    => 'name',
		label   => 'Role Name',
		constraint => ['Required'],
	       });


t/lib/MyApp/Controller/Admin/User.pm  view on Meta::CPAN

}

=head2 add_user

add a user

=cut
sub add_user : Chained('base_user') :PathPart('add') Args(0) {
  my ( $self, $c ) = @_;

  $c->stash->{legend} = "Add_a_user";
  $c->forward('edit_user');
}

=head2 del_user

delete a user

=cut
sub del_user : Chained('user') :PathPart('del') Args(0){
    my ( $self, $c ) = @_;

t/lib/MyApp/Controller/Admin/User.pm  view on Meta::CPAN


=head2 edit_user

edit a user

=cut
sub edit_user : Chained('user') :PathPart('edit') Args(0){
  my ( $self, $c ) = @_;

  if ($c->stash->{user_id} ){
    $c->stash->{legend} = "Edit_a_user";

    my $user_roles_id;
    foreach my $role ( $c->stash->{user}->user_roles ){
      $user_roles_id->{$role->id} = 1;
    }
    $c->stash->{user_roles_id} = $user_roles_id;


    my $user_actions_id;
    foreach my $action ( $c->stash->{user}->actions ){

t/lib/MyApp/Controller/Admin/User.pm  view on Meta::CPAN

    $c->stash->{user_actions_id} = $user_actions_id;
  }

  $c->stash->{allroles}   = $c->model('DBIC::Role');
  $c->stash->{allactions} = $c->model('DBIC::Action');


  # form FormFu ------------------------------------
  my $form = HTML::FormFu->new;

  my $fs = $form->element('Fieldset')->legend($c->stash->{legend})->attrs({ class => 'alt'});


  $fs->element(
	       {type    => 'Text',
		name    => 'name',
		label   => 'Name',
		constraint => ['Required'],
	       });

  $fs->element(

t/root/src/admin/role/edit_role.tt  view on Meta::CPAN

<h1 class="caps">Edit role [% role_id %]</h1>
[% form %]


<div class="span-24">

<div class="span-11">
<form action="/admin/role/[% role_id %]/role/" method="post">
<fieldset>
<legend class="alt">Role_Role</legend>


  <table>
  [% WHILE  (role=allroles.next) -%] 
  [% IF role.id == role_id ; NEXT;  END %]

    <tr>
       <td><a href="/admin/role/[% role.id %]/edit">[% role.name %]</a></td>

  [% IF dont_print_childrens_role.defined(role.name) || dont_print_parents_role.defined(role.name) %]

t/root/src/admin/role/edit_role.tt  view on Meta::CPAN

  </div>

</fieldset>
</form>
</div>


<div class="span-12">
<form action="/admin/role/[% role_id %]/action/" method="post">
<fieldset>
<legend class="alt">Role_Action</legend>

  <table>
  [% WHILE  (action=allactions.next) -%] 
  <tr>
      <td><a href="/admin/action/[% action.id %]/edit">[% action.name %]</a></td>
      <td>
         <input type="checkbox" name="action" value=[% action.id %]
  [% IF role_actions_id.defined(action.id) %]
       checked
  [% END %]

t/root/src/admin/user/edit_user.tt  view on Meta::CPAN

<h1 class="caps">Edit user [% user_id %]</h1>

[% form %]


<div class="span-24">
<div class="span-11">
<form action="/admin/user/[% user_id %]/role/" method="post">
<fieldset>
<legend class="alt">User_Role</legend>

<table>
[% WHILE  (role=allroles.next) -%]
  <tr>
      <td><a href="/admin/role/[%  role.id %]/edit">[% role.name %]</a></td>
      <td><input type="checkbox" name="role" value=[% role.id %] 
  [% IF user_roles_id.defined(role.id) %]
       checked 
  [% END %] 
></td>

t/root/src/admin/user/edit_user.tt  view on Meta::CPAN

</div>

</fieldset>
</form>
</div>


<div class="span-12">
<form action="/admin/user/[% user_id %]/action/" method="post">
<fieldset>
<legend class="alt">User_Action</legend>

<table>
[% WHILE  (action=allactions.next) -%]
  <tr>
    <td><a href="/admin/action/[%  action.id %]/edit">[% action.name %]</a></td>
    <td><input type="checkbox" name="action" value=[% action.id %] 
  [% IF user_actions_id.defined(action.id) %]
       checked 
  [% END %] 
></td>

t/root/static/css/blueprint/ie.css  view on Meta::CPAN

   * See README for instructions on how to use Blueprint.
   * For credits and origins, see AUTHORS.
   * This is a compressed file. See the sources in the 'src' directory.

----------------------------------------------------------------------- */

/* ie.css */
body {text-align:center;}
.container {text-align:left;}
* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * htm...
* html legend {margin:0px -8px 16px 0;padding:0;}
sup {vertical-align:text-top;}
sub {vertical-align:text-bottom;}
html>body p code {*white-space:normal;}
hr {margin:-8px auto 11px;}
img {-ms-interpolation-mode:bicubic;}
.clearfix, .container {display:inline-block;}
* html .clearfix, * html .container {height:1%;}
fieldset {padding-top:0;}
legend {margin-top:-0.2em;margin-bottom:1em;margin-left:-0.5em;}
textarea {overflow:auto;}
label {vertical-align:middle;position:relative;top:-0.25em;}
input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
input.text:focus, input.title:focus {border-color:#666;}
input.text, input.title, textarea, select {margin:0.5em 0;}
input.checkbox, input.radio {position:relative;top:.25em;}
form.inline div, form.inline p {vertical-align:middle;}
form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;}
button, input.button {position:relative;top:0.25em;}

t/root/static/css/blueprint/screen.css  view on Meta::CPAN


   * Copyright (c) 2007-Present. See LICENSE for more info.
   * See README for instructions on how to use Blueprint.
   * For credits and origins, see AUTHORS.
   * This is a compressed file. See the sources in the 'src' directory.

----------------------------------------------------------------------- */

/* reset.css */
html {margin:0;padding:0;border:0;}
body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside...
article, aside, details, figcaption, figure, dialog, footer, header, hgroup, menu, nav, section {display:block;}
body {line-height:1.5;background:white;}
table {border-collapse:separate;border-spacing:0;}
caption, th, td {text-align:left;font-weight:normal;float:none !important;}
table, th, td {vertical-align:middle;}
blockquote:before, blockquote:after, q:before, q:after {content:'';}
blockquote, q {quotes:"" "";}
a img {border:none;}
:focus {outline:0;}

t/root/static/css/blueprint/screen.css  view on Meta::CPAN

.added {background:#060;color:#fff;}
.removed {background:#900;color:#fff;}
.first {margin-left:0;padding-left:0;}
.last {margin-right:0;padding-right:0;}
.top {margin-top:0;padding-top:0;}
.bottom {margin-bottom:0;padding-bottom:0;}

/* forms.css */
label {font-weight:bold;}
fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
legend {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;}
fieldset, #IE8#HACK {padding-top:1.4em;}
legend, #IE8#HACK {margin-top:0;margin-bottom:0;}
input[type=text], input[type=password], input[type=url], input[type=email], input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;color:#000;}
input[type=text]:focus, input[type=password]:focus, input[type=url]:focus, input[type=email]:focus, input.text:focus, input.title:focus, textarea:focus {border-color:#666;}
select {background-color:#fff;border-width:1px;border-style:solid;}
input[type=text], input[type=password], input[type=url], input[type=email], input.text, input.title, textarea, select {margin:0.5em 0;}
input.text, input.title {width:300px;padding:5px;}
input.title {font-size:1.5em;}
textarea {width:390px;height:250px;padding:5px;}
form.inline {line-height:3;}
form.inline p {margin-bottom:0;}
.error, .alert, .notice, .success, .info {padding:0.8em;margin-bottom:1em;border:2px solid #ddd;}



( run in 1.346 second using v1.01-cache-2.11-cpan-49f99fa48dc )